Skip to content

Testing modified files in CI breaks warn_external and relative imports in tests #8166

Closed

Description

@lagru

The recently merged infrastructure to test changed files only still has some problems. This was surfaced in

It seems that whatever happens if the --installed flag is passed to spin test, warn_external breaks. I suspect because the paths passed to skip_file_prefixes don't match the actual install paths at runtime. I don't yet understand where or how this happens in .spin/cmds.py.

Also, I think the fact that --test-modified passes subdirs of the test directory to pytest also breaks relative imports in the test suite that work if invoked normally. For example see this run:

ERROR tests/skimage/feature/test_util.py - ModuleNotFoundError: No module named 'tests.dependency_checks'; 'tests' is not a package
ERROR tests/skimage/filters/test_thresholding.py - ModuleNotFoundError: No module named 'tests.dependency_checks'; 'tests' is not a package
ERROR tests/skimage/transform/test_radon_transform.py - ModuleNotFoundError: No module named 'tests.dependency_checks'; 'tests' is not a package

And third, are we sure that the run-all-tests label is picked up by the process-labels workflow correctly?
This process-labels job still sets HAS_LABEL: false for some reason. I thought that adding the label and requesting a rerun would be enough.

Activity

  1. added
    🤖 type: Infrastructure
    on May 16, 2026
  2. lagru commented on May 16, 2026

    @lagru
    MemberAuthor

    Might also be useful to look into keeping the invocation of spin test and the test configuration reasonably similar to the local setup. I think that was the reason for using spin test in the CI in the first place? Creating a significantly different test environment with the --installed --test-modified flags defeats that purpose somewhat.

  3. blink1073 commented on May 17, 2026

    @blink1073
    Contributor

    I thought that adding the label and requesting a rerun would be enough.

    Ah, no, that would require more complicated logic, to get the label from the PR instead of the event.

  4. blink1073 commented on May 17, 2026

    @blink1073
    Contributor

    Here's a better label handler: #8169

  5. blink1073 commented on May 18, 2026

    @blink1073
    Contributor

    I have a branch that verifies a fix for #8069, as a PR to my fork: blink1073#8. I'm going to make it a standalone fix, and add the ability to run --test-modified and --installed locally to make it easier to reproduce what is going on in CI.

  6. blink1073 commented on May 18, 2026

    @blink1073
    Contributor

    PR: #8173

  7. self-assigned this
    on May 18, 2026
  8. blink1073 commented on May 22, 2026

    @blink1073
    Contributor

    Closing as completed by #8169 and #8173

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

Metadata

Metadata

Assignees

Labels

🐛 Bug🤖 type: Infrastructure

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions