Skip to content

Add option to skip slow tests in PRs#3060

Merged
winglian merged 24 commits intomainfrom
more_skip_options
Aug 14, 2025
Merged

Add option to skip slow tests in PRs#3060
winglian merged 24 commits intomainfrom
more_skip_options

Conversation

@salmanmohammadi
Copy link
Contributor

@salmanmohammadi salmanmohammadi commented Aug 12, 2025

Summary by CodeRabbit

  • Chores

    • Centralized CI gating to compute a single “skip e2e” decision used by downstream jobs; preserved owner and non-draft PR requirements.
  • Tests

    • E2E runs can be selectively skipped using “[skip-e2e]” in commit messages, PR title, or PR body (case-insensitive); decision considers the latest PR commit and is applied consistently across e2e jobs.
  • Documentation

    • CONTRIBUTING guidance added explaining how to skip CI or only e2e checks via skip tokens.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 12, 2025

📝 Walkthrough

Walkthrough

Adds a new GitHub Actions job gate-skip-e2e that computes whether to skip E2E runs by scanning commit messages, PR title, and PR body for a case-insensitive [skip-e2e] token; updates docker-e2e-tests-1st and docker-e2e-tests to depend on this job and gate execution using its skip output plus existing owner and non-draft checks; adds CONTRIBUTING guidance for skipping CI/E2E.

Changes

Cohort / File(s) Summary of changes
New gating job
.github/workflows/tests.yml
Added gate-skip-e2e job (needs: pre-commit, pytest, pytest-sdist) that runs actions/github-script@v7 to check for /\[skip-e2e\]/i in push head commit, PR last commit message, PR title, and PR body; exposes output skip.
Updated E2E jobs to consume skip output
.github/workflows/tests.yml
Modified docker-e2e-tests-1st and docker-e2e-tests to include gate-skip-e2e in needs and to add needs.gate-skip-e.outputs.skip != 'true' to their if conditions while preserving owner axolotl-ai-cloud and non-draft PR logic.
Documentation update
.github/CONTRIBUTING.md
Added "Skipping CI Checks" guidance explaining [skip ci]/skip ci to skip all CI and [skip-e2e]/skip-e2e to skip only end-to-end tests; notes that placing the skip tag in the PR title disables E2E for the PR; inserted in two locations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Skip CI for draft PRs #2970 — Modifies the same GitHub Actions workflow jobs in .github/workflows/tests.yml to gate E2E jobs and adjust PR/draft conditional checks.

Suggested reviewers

  • winglian
  • NanoCode012
  • djsaunde
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch more_skip_options

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d45620 and 5222bd9.

📒 Files selected for processing (3)
  • .github/workflows/multi-gpu-e2e.yml (1 hunks)
  • .github/workflows/tests.yml (1 hunks)
  • src/axolotl/cli/train.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.12.2)
src/axolotl/cli/train.py

32-32: Local variable x is assigned to but never used

Remove assignment to unused variable x

(F841)

🪛 Flake8 (7.2.0)
src/axolotl/cli/train.py

[error] 32-32: local variable 'x' is assigned to but never used

(F841)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: PyTest (3.11, 2.7.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.0)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.6.0)
  • GitHub Check: PyTest (3.11, 2.6.0)
  • GitHub Check: PyTest (3.11, 2.7.0)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.6.0, 2, true)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.7.0, 2, true)

@codecov
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@winglian
Copy link
Collaborator

Screenshot 2025-08-12 at 4 09 37 PM shouldn't it have skipped the e2e tests for the latest commit?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🔭 Outside diff range comments (2)
.github/workflows/tests.yml (1)

1-333: Re-enable the CI workflow and implement robust “[skip-e2e]” gating

All lines in .github/workflows/tests.yml are currently commented out, disabling every job (actionlint: “workflow is empty”) and breaking CI. Please restore the workflow’s core structure and add skip-logic that:

  • Works on both push and pull_request events
  • Honors “[skip-e2e]” and “[skip e2e]” in PR title, body, or labels
  • Checks head_commit.message for non-PR events
  • Applies the draft guard only on pull_request

Locations needing attention:

  • File: .github/workflows/tests.yml (lines 1–333)
    • Uncomment the top-level name:, on:, jobs:, and all job definitions
    • Restore the pre-commit, pytest, pytest-sdist, and docker-e2e jobs

Replace each docker-e2e job’s if: with:

-    if: ${{ ! contains(github.event.head_commit.message, '[skip-e2e]') && github.repository_owner == 'axolotl-ai-cloud' && !github.event.pull_request.draft }}
+    if: ${{ !(
+        (github.event_name == 'pull_request' && (
+          contains(github.event.pull_request.title, '[skip-e2e]') ||
+          contains(github.event.pull_request.body,  '[skip-e2e]') ||
+          contains(github.event.pull_request.labels.*.name, 'skip-e2e') ||
+          contains(github.event.pull_request.title, '[skip e2e]') ||
+          contains(github.event.pull_request.body,  '[skip e2e]') ||
+          contains(github.event.pull_request.labels.*.name, 'skip e2e')
+        )) ||
+        (github.event_name != 'pull_request' && (
+          contains(github.event.head_commit.message  || '', '[skip-e2e]') ||
+          contains(github.event.head_commit.message  || '', '[skip e2e]')
+        ))
+      ) 
+      && github.repository_owner == 'axolotl-ai-cloud' 
+      && (github.event_name != 'pull_request' || !github.event.pull_request.draft) }}

Apply the same block to both docker-e2e-tests-1st and docker-e2e-tests jobs.

.github/workflows/multi-gpu-e2e.yml (1)

1-76: Critical: Workflow fully disabled; re-enable and harden skip gating

The multi-GPU E2E workflow in .github/workflows/multi-gpu-e2e.yml is currently entirely commented out, so no jobs run—even when they should. Rather than hiding the problem, restore the workflow and update its if: condition to reliably skip only when intended:

• File: .github/workflows/multi-gpu-e2e.yml
• Scope: job-level if: for test-axolotl-multigpu

Suggested diff (replace the commented-out if: at line 24):

-#     if: ${{ ! contains(github.event.commits[0].message, '[skip e2e]') && github.repository_owner == 'axolotl-ai-cloud' && (github.event_name != 'pull_request' || !github.event.pull_request.draft) }}
+    if: ${{ !(
+        (github.event_name == 'pull_request' && (
+          contains(github.event.pull_request.title, '[skip-e2e]') ||
+          contains(github.event.pull_request.body,  '[skip-e2e]') ||
+          contains(github.event.pull_request.labels.*.name, 'skip-e2e') ||
+          contains(github.event.pull_request.title, '[skip e2e]') ||
+          contains(github.event.pull_request.body,  '[skip e2e]') ||
+          contains(github.event.pull_request.labels.*.name, 'skip e2e')
+        )) ||
+        (github.event_name != 'pull_request' && (
+          contains(github.event.head_commit.message  || '', '[skip-e2e]') ||
+          contains(github.event.head_commit.message  || '', '[skip e2e]')
+        ))
+      ) 
+      && github.repository_owner == 'axolotl-ai-cloud' 
+      && (github.event_name != 'pull_request' || !github.event.pull_request.draft) 
+    }}

Notes:

  • github.event.commits[0].message is undefined for PRs and unreliable on pushes.
  • Use PR title/body/labels for PRs; head_commit.message for pushes.

After re-enabling, open a PR with only a [skip-e2e] label (no code changes) to confirm the job skips, and verify it still runs on workflow_dispatch or schedule when no skip marker is present.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72f9445 and 735c942.

📒 Files selected for processing (3)
  • .github/workflows/debug-commit-message.yml (1 hunks)
  • .github/workflows/multi-gpu-e2e.yml (1 hunks)
  • .github/workflows/tests.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: SalmanMohammadi
PR: axolotl-ai-cloud/axolotl#2994
File: index.qmd:7-8
Timestamp: 2025-07-31T11:48:46.313Z
Learning: In documentation workflow testing PRs, temporary test content like "test test" may be intentionally added to trigger documentation preview actions and validate workflow fixes, rather than being accidental debug text.
🪛 actionlint (1.7.7)
.github/workflows/tests.yml

1-1: workflow is empty

(syntax-check)

.github/workflows/debug-commit-message.yml

12-12: "github.event.head_commit.message" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details

(expression)

.github/workflows/multi-gpu-e2e.yml

1-1: workflow is empty

(syntax-check)

🪛 YAMLlint (1.37.1)
.github/workflows/debug-commit-message.yml

[error] 20-20: trailing spaces

(trailing-spaces)


[error] 26-26: trailing spaces

(trailing-spaces)


[error] 31-31: no new line character at the end of file

(new-line-at-end-of-file)

🪛 GitHub Actions: lint
.github/workflows/debug-commit-message.yml

[error] 1-1: End-of-file-fixer: Files were modified to fix end-of-file newline.


[error] 1-1: Trailing-whitespace: Trailing whitespace removed by pre-commit hook.

@salmanmohammadi
Copy link
Contributor Author

shouldn't it have skipped the e2e tests for the latest commit?

Yes. It should be working now

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
.github/workflows/tests.yml (1)

201-217: Harden skip detection: include PR labels and accept “[skip e2e]” (legacy) token

Covers more authoring styles without false positives, aligns with prior discussion, and avoids brittle reliance on commit message alone.

Apply this diff:

-            const token = /\[skip-e2e\]/i;
+            const token = /\[skip-e2e\]/i;
+            const legacyToken = /\[skip e2e\]/i;
             let msg = '';
             if (context.eventName === 'push') {
               msg = context.payload.head_commit?.message || '';
             } else if (context.eventName === 'pull_request') {
               const { owner, repo } = context.repo;
               const prNumber = context.payload.pull_request.number;
               const commits = await github.paginate(
                 github.rest.pulls.listCommits,
                 { owner, repo, pull_number: prNumber, per_page: 100 }
               );
               msg = commits.at(-1)?.commit?.message || '';
             }
             const title = context.payload.pull_request?.title || '';
             const body  = context.payload.pull_request?.body  || '';
-            const skip = token.test(msg) || token.test(title) || token.test(body);
+            const labels = (context.payload.pull_request?.labels || []).map(l => l.name || '');
+            const inLabels = labels.some(n => token.test(n) || legacyToken.test(n));
+            const skip =
+              token.test(msg) || token.test(title) || token.test(body) ||
+              legacyToken.test(msg) || legacyToken.test(title) || legacyToken.test(body) ||
+              inLabels;
             core.setOutput('skip', String(skip));
🧹 Nitpick comments (1)
.github/workflows/tests.yml (1)

192-192: Compute skip decision as early as possible by removing unnecessary needs

The gate job doesn’t require results from pre-commit/pytest to compute its output. Dropping this dependency yields earlier feedback and doesn’t change downstream gating (those jobs already need pre-commit/pytest).

Apply this diff:

-    needs: [pre-commit, pytest, pytest-sdist]
+    # No needs here so we compute skip ASAP in parallel
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c998164 and 5cdc402.

📒 Files selected for processing (1)
  • .github/workflows/tests.yml (2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/tests.yml

226-226: label "modal" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


279-279: label "modal" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🔇 Additional comments (4)
.github/workflows/tests.yml (4)

221-224: Good guard on PR-only fields and proper consumption of the gate output

Condition safely handles non-PR events and correctly skips when the gate indicates so.


228-229: Correct dependency wiring

Adding gate-skip-e2e to needs ensures availability of its outputs for gating execution.


274-277: Consistent gating across the second E2E job

Mirrors the same safe conditions as the first job; looks good.


283-283: Dependency ordering is sound

Requiring the gate and the first e2e job prevents wasting GPU cycles when the gate decides to skip or when the first e2e fails.

@NanoCode012
Copy link
Collaborator

Should it be the opposite for these tests? Should we only run it after an approve (via a comment by maintainer) rather than skip?

@salmanmohammadi
Copy link
Contributor Author

Should it be the opposite for these tests? Should we only run it after an approve (via a comment by maintainer) rather than skip?

The current behaviour isn't changed, this PR just allows for the slow tests to be skipped if they're not needed.

@NanoCode012
Copy link
Collaborator

Should we document this option to .github/CONTRIBUTING.md? We should also add a note on [skip ci] via https://docs.github.com/en/actions/how-tos/manage-workflow-runs/skip-workflow-runs

@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 2025

📖 Documentation Preview: https://689c813b7d1f3a81d35fa972--resonant-treacle-0fd729.netlify.app

Deployed on Netlify from commit 1f66e06

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/CONTRIBUTING.md (2)

71-72: Replace placeholder code style link

The {codestyle} and {URLofCodestyle} placeholders appear unfinished. Replace with the actual style guide (e.g., Black/Ruff, or a local doc), or remove if not applicable.

I can update this to reference your actual tooling (e.g., Black, Ruff, isort) if you confirm what the project uses.


81-82: Duplicate placeholder link

Same placeholder duplication here; replace with the real link or remove.

Happy to update once you confirm the intended target.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5cdc402 and 1f66e06.

📒 Files selected for processing (1)
  • .github/CONTRIBUTING.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: pre-commit
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.6.0)
  • GitHub Check: PyTest (3.11, 2.7.1)
  • GitHub Check: PyTest (3.11, 2.7.0)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.0)
  • GitHub Check: PyTest (3.11, 2.6.0)
  • GitHub Check: preview
  • GitHub Check: pre-commit

@winglian
Copy link
Collaborator

It might be worth adding this to the multi-gpu yaml as well

@winglian winglian merged commit d1de6f5 into main Aug 14, 2025
16 checks passed
@winglian winglian deleted the more_skip_options branch August 14, 2025 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants