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 only a subset of tests on PRs that only modify the manual #243

Open
DilumAluthge opened this issue Nov 10, 2022 · 8 comments · May be fixed by #400
Open

Run only a subset of tests on PRs that only modify the manual #243

DilumAluthge opened this issue Nov 10, 2022 · 8 comments · May be fixed by #400

Comments

@DilumAluthge
Copy link
Member

If a PR only modifies the manual, then we only need to run a subset of jobs, including:

  1. Build a regular (non-assert) build of Julia on x86_64-linux-gnu
  2. Build the docs
  3. Run the doctests
@giordano
Copy link
Contributor

And PRs editing only the readme shouldn't run anything

@DilumAluthge
Copy link
Member Author

Cross-ref JuliaLang/julia#45744

@staticfloat
Copy link
Member

I think the way to do this is to have a "filter" that looks at the diff, and skips launching a job if the diff does not contain changes to a particular group of files. We can also construct this negatively, e.g. filter out elements of a diff, and then run if any diff remains.

The way I'm imagining this is to write a buildkite plugin that does something like the following:

steps:
  - label: launch jobs
    plugins:
      - JuliaCI/diff-filter#v1:
          docs:
            # Only run docs if we have a diff that changes something in `doc/`
            mode: positive
            patterns:
              - "doc/**"
          build:
            # Run build if anything changes, excluding changes to docs, README, etc...
            mode: negative
            patterns:
              - "doc/**"
              - "README.md"
    commands: |
      if [[ $${BUILDKITE_PLUGIN_DIFF_FILTER_TRIGGERED_DOCS} == 1 ]]; then
          buildkite-agent upload docs.yml
      fi
      if [[ $${BUILDKITE_PLUGIN_DIFF_FILTER_TRIGGERED_BUILD} == 1 ]]; then
          buildkite-agent upload build.yml
      fi

@giordano
Copy link
Contributor

In Yggdrasil we collect the files modified in a PR/commit: https://github.com/JuliaPackaging/Yggdrasil/blob/fb8152880d5bb011c4ab2a23b84fff2327c1ee17/azure-pipelines.yml#L81-L86. Valentin will have done something similar with buildkite in JuliaPackaging/Yggdrasil#4771

@fatteneder
Copy link
Member

I put together a plugin based on @staticfloat idea: https://github.com/fatteneder/diff-filter-buildkite-plugin

It seems to work fine in my tests: https://buildkite.com/testingplugin/bash-example/builds/63#0192d94f-a732-4f76-bb12-ad2262b75cc9

How would I go about testing it with the Julia repo?
Just open a PR here?

@giordano
Copy link
Contributor

It seems to work fine in my tests: buildkite.com/testingplugin/bash-example/builds/63#0192d94f-a732-4f76-bb12-ad2262b75cc9

I get "page not found"

How would I go about testing it with the Julia repo?
Just open a PR here?

Think so.

@fatteneder
Copy link
Member

I get "page not found"

My bad, pipeline was private, should work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants