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

nx-cloud workflow doesn't work with karma test #12045

Closed
DaSchTour opened this issue Sep 16, 2022 · 5 comments · Fixed by #14215
Closed

nx-cloud workflow doesn't work with karma test #12045

DaSchTour opened this issue Sep 16, 2022 · 5 comments · Fixed by #14215
Assignees

Comments

@DaSchTour
Copy link
Contributor

The test target uses the ci flag which is only supported by jest and not by karma. This probably will also cause issues in setups with jest and karma tests mixed.

Current Behavior

Test target fails with 'ci' is not found in schema

Expected Behavior

Test target should not fail

Steps to Reproduce

  • Create a project with karma as test suite
  • Run the @nrwl/workspace:ci-workflow generator with Github as CI (probably also true for others)

Failure Logs

'ci' is not found in schema

Environment

Node : 16.17.0
OS : darwin x64
npm : 8.15.0

nx : 14.7.5
@nrwl/angular : 14.7.5
@nrwl/cypress : 14.7.5
@nrwl/detox : Not Found
@nrwl/devkit : 14.7.5
@nrwl/eslint-plugin-nx : 14.7.5
@nrwl/express : Not Found
@nrwl/jest : 14.7.5
@nrwl/js : 14.7.5
@nrwl/linter : 14.7.5
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : 14.6.2
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.7.5
@nrwl/web : 14.7.5
@nrwl/workspace : 14.7.5
typescript : 4.8.3

Local workspace plugins:

Community plugins:
@jscutlery/semver: 2.27.0
ngx-deploy-npm: 4.2.4

@StalkAltan StalkAltan self-assigned this Sep 16, 2022
@StalkAltan
Copy link
Member

Hi @DaSchTour !

The commands generated for the Nx Cloud workflow are just meant as a general example -- feel free to adjust them to fit the needs of your project. Whether that's moving the ci flag into a configuration for your jest targets, or renaming your karma/jest targets so they don't use the same name (ex: test => test-jest, test-karma), there are a variety of options to get this working for your needs!

For that reason, I'm going to close this issue, since this is fixable with user configuration.

@DaSchTour
Copy link
Contributor Author

@StalkAltan well, that still is some unfortunate combination that from my experience will scare certain type of inexperienced developers.

@harellevy
Copy link

@DaSchTour Did you manage to solve this with mixed Karma and Jest workflows? This appears to be an issue for me also.

@DaSchTour
Copy link
Contributor Author

@harellevy no I did not have mixed tests in one repo. Probably the only solution ist to create a configuration for ci and use --configuration=ci and add ci:true as an option to the ci configuration in jest targets.
Probably this could have been something NX could already do upfront. Would probably avoid a lot of trouble for some devs.

DaSchTour added a commit to DaSchTour/nx that referenced this issue Jan 7, 2023
make test task depend less on jest specific options and use configuration instead to be more
inclusive

ISSUES CLOSED: nrwl#12045
DaSchTour added a commit to DaSchTour/nx that referenced this issue Jan 10, 2023
make test task depend less on jest specific options and use configuration instead to be more
inclusive

ISSUES CLOSED: nrwl#12045
DaSchTour added a commit to DaSchTour/nx that referenced this issue Jan 21, 2023
make test task depend less on jest specific options and use configuration instead to be more
inclusive

ISSUES CLOSED: nrwl#12045
DaSchTour added a commit to DaSchTour/nx that referenced this issue Jan 21, 2023
make test task depend less on jest specific options and use configuration instead to be more
inclusive

ISSUES CLOSED: nrwl#12045
DaSchTour added a commit to DaSchTour/nx that referenced this issue Jan 21, 2023
make test task depend less on jest specific options and use configuration instead to be more
inclusive

ISSUES CLOSED: nrwl#12045
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
github-actions bot pushed a commit to ng-Classic/ng-classic that referenced this issue Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants