GeezerVison is showing github.com — Only run tests for modules affected by a PR · Issue #2277 · googleapis/google-cloud-python
Only run tests for modules affected by a PR #2277DescriptionInspired by googleapis/google-cloud-node#1579
This may require building a directed graph (based on direct imports) and traversing the graph. We could use networkx for this, or maybe pylint already has tooling for dependency graphs. Activitytseaver commented on Sep 8, 2016 Seems like overkill: all 2160 unit tests run in under 4 seconds on my machine. Now, if we could prune the system tests, that would be a win (but only after merge, of course). dhermes commented on Sep 8, 2016 ContributorAuthor More actions Yes "Only run tests" was meant to include all tests (maybe unit tests not relevant as you point out) theacodes commented on Sep 8, 2016 dhermes commented on Sep 8, 2016 ContributorAuthor More actions Ha, some bubble gum there for sure. When I tried to use the TRAVIS_COMMIT env. var. long ago (like almost 2 whole years) it was not consistently populated. theacodes commented on Sep 9, 2016 dhermes commented on Sep 13, 2016 ContributorAuthor More actions I wanted to summarize how TRAVIS_* env. vars. are used in what @jonparrott linked to. Essentially, they are only used to detect if on Travis (${TRAVIS} == true) and to get a list of changed files in the build:
if ${TRAVIS_PULL_REQUEST} == false
git show --pretty=format: --name-only ${TRAVIS_COMMIT}
else
try
git diff --name-only ${TRAVIS_COMMIT} ${TRAVIS_BRANCH}
fallback
HEAD_COMMIT = git rev-parse HEAD
git diff --name-only ${HEAD_COMMIT} ${TRAVIS_BRANCH}
end
end
daspecster commented on Sep 13, 2016 All system tests should be run before a release is tagged. I think the danger of some change affecting another module in some way would outweigh the speed savings. dhermes commented on Sep 13, 2016 ContributorAuthor More actions That's why I suggested building the dependency graph. daspecster commented on Sep 13, 2016 I'm skeptical that a dependency graph would catch everything all the time. Just seems like adding risk?
I may just be paranoid. dhermes commented on Sep 13, 2016 ContributorAuthor More actions Yes you are definitely paranoid. If code A doesn't depend on code B (whether directly, or indirectly, as traced along the dependency graph) then code B can be completely changed without ever making an impact on the performance of code A (with lots of caveats, e.g. code B can't delete the OS). daspecster commented on Sep 13, 2016 Yeah I understand. I withdraw my concerns based on your confidence.
Just make sure whatever makes the graph works with namespaced packages 😉! tseaver commented on Sep 13, 2016 Relying on a third-party dependency-graph analysis tool does add risks: if it has bugs, we could end up not testing code which actually is affected by a change. dhermes commented on Sep 14, 2016 ContributorAuthor More actions Worth noting that TRAVIS_COMMIT_RANGE is worthless sometimes, but AFAICT this only happens when rebases / force-pushes occur. Otherwise, the TRAVIS_COMMIT_RANGE looks like ${START}...${END} where END is just the HEAD commit in the branch that was pushed and START is the last value of START in a Travis build for that branch. pkch commented on Apr 20, 2017 Did you close this because the potential benefit doesn't seem to be worth the effort, or because this problem was solved through some other PRs? We're dealing with the same question in our project, so I was hoping to borrow ideas =) dhermes commented on Apr 20, 2017 ContributorAuthor More actions
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|