GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #2277

New issue
Copy link
New issue
Copy link
Closed
Closed
Only run tests for modules affected by a PR#2277
Copy link
Assignees
lukesneeringer
Labels
testing

Description

@dhermes
dhermes
opened on Sep 8, 2016
Issue body actions

Inspired 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.

Activity

  1. dhermes
    added
    testing
    on Sep 8, 2016
  2. tseaver commented on Sep 8, 2016

    @tseaver
    tseaver
    on Sep 8, 2016
    Contributor
    More actions

    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).

  3. dhermes commented on Sep 8, 2016

    @dhermes
    dhermes
    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)

  4. theacodes commented on Sep 8, 2016

    @theacodes
    theacodes
    on Sep 8, 2016
    Contributor
    More actions

    @dhermes in python-docs-samples we make nox gather a list of changed files and then filter the list of samples to test based on that. Maybe some of that code could be useful to you?

  5. dhermes commented on Sep 8, 2016

    @dhermes
    dhermes
    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.

  6. theacodes commented on Sep 9, 2016

    @theacodes
    theacodes
    on Sep 9, 2016
    Contributor
    More actions

    Yep, that's why we have a fallback that uses HEAD.

    On Thu, Sep 8, 2016, 3:38 PM Danny Hermes [email protected] wrote:

    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.

    —
    You are receiving this because you commented.

    Reply to this email directly, view it on GitHub
    #2277 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AAPUc_oO1T7O24aFfDs6O2oYicXiKb0Nks5qoI5ygaJpZM4J4bOm
    .

  7. dhermes
    added 2 commits that reference this issue on Sep 12, 2016

    Test commit: inspect the env. vars. Travis uses.

    d038c32

    Test commit: inspect the env. vars. Travis uses.

    b6f6ed4
  8. dhermes commented on Sep 13, 2016

    @dhermes
    dhermes
    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
    
  9. dhermes
    added a commit that references this issue on Sep 13, 2016

    Test commit: inspect the env. vars. Travis uses.

    dee6955
  10. daspecster commented on Sep 13, 2016

    @daspecster
    daspecster
    on Sep 13, 2016
    Contributor
    More actions

    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.

  11. dhermes commented on Sep 13, 2016

    @dhermes
    dhermes
    on Sep 13, 2016
    ContributorAuthor
    More actions

    That's why I suggested building the dependency graph.

  12. daspecster commented on Sep 13, 2016

    @daspecster
    daspecster
    on Sep 13, 2016
    Contributor
    More actions

    I'm skeptical that a dependency graph would catch everything all the time. Just seems like adding risk?

    I may just be paranoid.

  13. dhermes commented on Sep 13, 2016

    @dhermes
    dhermes
    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).

  14. daspecster commented on Sep 13, 2016

    @daspecster
    daspecster
    on Sep 13, 2016
    Contributor
    More actions

    Yeah I understand. I withdraw my concerns based on your confidence.

    Just make sure whatever makes the graph works with namespaced packages 😉!

  15. tseaver commented on Sep 13, 2016

    @tseaver
    tseaver
    on Sep 13, 2016
    Contributor
    More actions

    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.

  16. dhermes commented on Sep 14, 2016

    @dhermes
    dhermes
    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.

  17. dhermes
    added a commit that references this issue on Sep 22, 2016

    Test commit: inspect the env. vars. Travis uses.

    e0679df
  18. dhermes
    added a commit that references this issue on Oct 4, 2016

    Test commit: inspect the env. vars. Travis uses.

    df71963
  19. dhermes
    added a commit that references this issue on Nov 15, 2016

    Test commit: inspect the env. vars. Travis / CircleCI use.

    2a9b150
  20. lukesneeringer
    closed this as completedon Apr 19, 2017
  21. pkch commented on Apr 20, 2017

    @pkch
    pkch
    on Apr 20, 2017
    More actions

    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 =)

  22. dhermes commented on Apr 20, 2017

    @dhermes
    dhermes
    on Apr 20, 2017
    ContributorAuthor
    More actions

    @pkch We have mostly solved it by examining the files in the new commits.

    I am trying to make this into a generic helper in http://ci-diff-helper.readthedocs.io/en/latest/ if you want to take a look.

    Reacted by Max
  23. JustinBeckwith
    assigned
    lukesneeringer
    on Feb 1, 2021
  24. parthea
    added a commit that references this issue on Nov 24, 2025

    chore(logging): standardize logging in _shared_macros (#2277)

    233dc9c
  25. parthea
    added a commit that references this issue on Mar 6, 2026

    docs: clarify the api_method arg for client.query() (#2277)

    8f4e683
  26. parthea
    added a commit that references this issue on Apr 1, 2026

    deps: fix missing CTEs in sqlglot v28 and relax version dependency (#…

    7b2a2fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lukesneeringer
    lukesneeringer

Labels

testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.