Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running test:services:trace, "Cannot find any files matching pattern "$*"" on Windows #8437

Open
alexandresanlim opened this issue Sep 25, 2022 · 10 comments
Labels
bug Bugs in badges and the frontend

Comments

@alexandresanlim
Copy link
Contributor

🕚 When did the problem start?

When start this sample to run my first test

🐞 Stack trace

<!-- Provide the complete stack trace from the CircleCI test summary. -->

PS C:\Workspace\shieldsale\shields> npm run test:services:trace -- --only=wercker

> shields.io@0.0.0 test:services:trace
> cross-env NODE_CONFIG_ENV=test TRACE_SERVICES=true npm run test:services -- $*


> shields.io@0.0.0 test:services
> cross-env NODE_CONFIG_ENV=test mocha core/service-test-runner/cli.js

Warning: Cannot find any files matching pattern "$*"
Running tests for 1 services: wercker.


Error: Unknown services: wercker
    at Runner.only (file:///C:/Workspace/shieldsale/shields/core/service-test-runner/runner.js:64:13)
    at file:///C:/Workspace/shieldsale/shields/core/service-test-runner/cli.js:127:10

@alexandresanlim alexandresanlim added the keep-service-tests-green Related to fixing failing tests of the services label Sep 25, 2022
@calebcartwright calebcartwright removed the keep-service-tests-green Related to fixing failing tests of the services label Sep 25, 2022
@calebcartwright
Copy link
Member

The output from this is just.. odd. Can you please confirm you are working a local copy of this repository (as opposed to a fork) and share which commit you are on?

@alexandresanlim
Copy link
Contributor Author

I'm working on this fork:
https://github.com/alexandresanlim/shields

@chris48s
Copy link
Member

If you just run npm run test:services -- --only="wercker", does that work?

@chris48s chris48s added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Sep 26, 2022
@alexandresanlim
Copy link
Contributor Author

If you just run npm run test:services -- --only="wercker", does that work?

Yes, I just ran this command according to the first line

@chris48s
Copy link
Member

OK. Thanks I guess the issue is that the $* in

"test:services:trace": "cross-env NODE_CONFIG_ENV=test TRACE_SERVICES=true npm run test:services -- $*",

doesn't work on Windows. Not sure how we work round that in a cross-platform way.

@chris48s chris48s changed the title Error to run sample test, "Cannot find any files matching pattern "$*"" Error running test:services:trace, "Cannot find any files matching pattern "$*"" on Windows Sep 27, 2022
@chris48s chris48s added bug Bugs in badges and the frontend and removed question Support questions, usage questions, unconfirmed bugs, discussions, ideas labels Sep 27, 2022
@alexandresanlim
Copy link
Contributor Author

@chris48s I have new changes to open a PR, can i open it without tests or waiting fix?

@chris48s
Copy link
Member

chris48s commented Oct 3, 2022

If you just want to run the tests for your new service, you can do it with npm run test:services -- only="your-service-name".

npm run test:services:trace is useful for debugging failing tests, but you should be able to submit a working PR without this issue being fixed.

@chris48s chris48s closed this as completed Oct 3, 2022
@chris48s chris48s reopened this Oct 3, 2022
@alexandresanlim
Copy link
Contributor Author

npm run test:services -- only="wercker" results in:

> shields.io@0.0.0 test:services
> cross-env NODE_CONFIG_ENV=test mocha core/service-test-runner/cli.js

Warning: Cannot find any files matching pattern "only=wercker"
Running all service tests.
(node:28572) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)


  0 passing (0ms)

PS C:\Workspace\shieldsale\shields>

andnpm run test:services -- --only=werckerresults in:

> shields.io@0.0.0 test:services
> cross-env NODE_CONFIG_ENV=test mocha core/service-test-runner/cli.js

Running tests for 1 services: wercker.

Error: Unknown services: wercker
    at Runner.only (file:///C:/Workspace/shieldsale/shields/core/service-test-runner/runner.js:64:13)
    at file:///C:/Workspace/shieldsale/shields/core/service-test-runner/cli.js:127:10
PS C:\Workspace\shieldsale\shields> 

@confused-Techie
Copy link
Contributor

Also on Windows, and also unable to run the test suite.

I tried a few different ways, which I'll detail below as well as the output received.

Windows: 22H2
Node: v16.16.0

Command:

npm run test:services

Output:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> shields.io@0.0.0 test:services
> cross-env NODE_CONFIG_ENV=test mocha core/service-test-runner/cli.js

Running all service tests.
(node:34612) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)

  0 passing (0ms)

Command:

npm run test:services -- --only="pub"

Output:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> shields.io@0.0.0 test:services
> cross-env NODE_CONFIG_ENV=test mocha core/service-test-runner/cli.js "--only=pub"

Running tests for 1 services: pub.


Error: Unknown services: pub
    at Runner.only (file:///D:/Personal%20Documents/GitHub%20Repositories/shields/core/service-test-runner/runner.js:64:13)
    at file:///D:/Personal%20Documents/GitHub%20Repositories/shields/core/service-test-runner/cli.js:127:10

Command:

npm run test:services:trace -- --only="pub"

Output:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> shields.io@0.0.0 test:services:trace
> cross-env NODE_CONFIG_ENV=test TRACE_SERVICES=true npm run test:services -- $* "--only=pub"

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> shields.io@0.0.0 test:services

Warning: Cannot find any files matching pattern "$*"
Running tests for 1 services: pub.


Error: Unknown services: pub
    at Runner.only (file:///D:/Personal%20Documents/GitHub%20Repositories/shields/core/service-test-runner/runner.js:64:13)
    at file:///D:/Personal%20Documents/GitHub%20Repositories/shields/core/service-test-runner/cli.js:127:10

Command:

npx mocha core/service-test-runner/cli.js --only="wercker"

Output:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Running tests for 1 services: wercker.


Error: Unknown services: wercker
    at Runner.only (file:///D:/Personal%20Documents/GitHub%20Repositories/shields/core/service-test-runner/runner.js:64:    at file:///D:/Personal%20Documents/GitHub%20Repositories/shields/core/service-test-runner/cli.js:127:10

@chris48s
Copy link
Member

We've now merged #8786 which should allow you to run the basic tests for a service (without :trace) e.g: npm run test:services -- --only="pub" (or whatever) natively on Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend
Projects
None yet
Development

No branches or pull requests

4 participants