Skip to content

test: only include packages updates since master #336

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

Merged
merged 4 commits into from
Aug 22, 2019

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Aug 22, 2019

Issue #, if available:
Fixes: #335

Description of changes:
While running tests, only include packages that have been updated since master
Doc: https://github.com/lerna/lerna/tree/master/core/filter-options#--since-ref
If there are no changes, it takes less than 1 min to run yarn test (yarn-test.log)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr
Copy link
Member Author

trivikr commented Aug 22, 2019

Travis CI build succeeds after adding --passWithNoTests for test-ci, but there's no coverage info posted by codecov

@trivikr
Copy link
Member Author

trivikr commented Aug 22, 2019

I ran commits in this PR on top of #317 and noticed that it's running pretest on all packages and not the ones changed since master (yarn-test-ci.log vs yarn-test.log)

Expected behavior: Run tests only on node-http-handler

@trivikr
Copy link
Member Author

trivikr commented Aug 22, 2019

For code in PR #317, I ran the following commands:

@trivikr
Copy link
Member Author

trivikr commented Aug 22, 2019

For code in PR #333, I ran the following commands:

@trivikr
Copy link
Member Author

trivikr commented Aug 22, 2019

lerna ls ignore private packages, so it was listing only one package in #336 (comment)

Confirmed that pretest runs on all dependencies of the edited packages.
For PR #333, confirmed that tests are run on 5 packages (2 edited packages, and 3 dependencies)
(yarn-test.log)

Lack of --include-filtered-dependents might break lerna publish
which is undesirable
@trivikr
Copy link
Member Author

trivikr commented Aug 22, 2019

Reintroduced --include-filtered-dependents
Confirmed that pretest runs on all dependents and dependencies of the edited packages.

@trivikr
Copy link
Member Author

trivikr commented Aug 22, 2019

Findings while going through lerna codebase:

  • the dependents and dependencies are added in (get-filtered-packages)
  • Definitions of dependencies and dependents in PackageGraph
    • Dependencies: if packageA depended on packageB graph.addDependencies([packageA]) would return [packageA, packageB].
    • Dependents: if packageC depended on packageD graph.addDependents([packageD]) would return [packageD, packageC].

@trivikr trivikr merged commit 1ef5488 into aws:master Aug 22, 2019
@trivikr trivikr deleted the lerna-since-master branch August 22, 2019 22:37
@trivikr
Copy link
Member Author

trivikr commented Aug 22, 2019

ToDo: verify CI runs in:

@lock
Copy link

lock bot commented Aug 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Travis CI exceeds the maximum time limit for jobs even for simple PRs
2 participants