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

Run tests for affected apps only #416

Closed
markphip opened this issue Apr 11, 2018 · 4 comments
Closed

Run tests for affected apps only #416

markphip opened this issue Apr 11, 2018 · 4 comments

Comments

@markphip
Copy link
Contributor

I started working on a PR to add support for affected:test. It is getting a bit bigger than I expected and I might be over my head now. But what has happened is I have run into this:

    Command failed: npm run affected:test -- --files="libs/mylib/index.ts"
    Nx only supports running unit tests for all apps and libs.
    You cannot use -a or --app.
    Use fdescribe or fit to select a subset of tests to run.
    child_process.js:615
        throw err;

This leads me to believe the lack of support for this feature was intentional. Is that true? If so, why? We are building out a monorepo with several apps in it and we wanted to setup our CI process to only run the tests for the app affected by the commit. We already do this nicely for the e2e tests.

Should I just abandon this idea?

markphip added a commit to markphip/nx that referenced this issue Apr 11, 2018
Add support for affected:test that works similar to the e2e
target except it runs test instead.  Theoretically useful
for a CI process to run the unit tests based on the apps
affected by the change.

This is WIP towards Issue nrwl#416
@markphip
Copy link
Contributor Author

I pushed my WIP so you can see the direction I was going with this. It seemed like a simple change at first but then led me down a rabbit hole of small changes I had to make for the tests until finally running into the mentioned message that made me stop and rethink it entirely. I am assuming you left this feature out for a philosophical reason of some kind?

@vsavkin
Copy link
Member

vsavkin commented Apr 25, 2018

It's tricky to make this functionality work in CLI 1.x, which is what the current version of Nx is using.

It's easier to make it work with CLI6, which provides more extension points. We are currently working on changing Nx to use CLI6, which should fix this issue.

@vsavkin vsavkin added this to the 2.0.0 milestone Apr 25, 2018
@vsavkin
Copy link
Member

vsavkin commented May 29, 2018

This functionality has been implemented in Nx 6.

@vsavkin vsavkin closed this as completed May 29, 2018
@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 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants