-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 doctests as part of CI pipeline #9939
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[profile.ci] | ||
# Print out output for failing tests as soon as they fail, and also at the end | ||
# of the run (for easy scrollability). | ||
failure-output = "immediate-final" | ||
# Do not cancel the test run on the first failure. | ||
fail-fast = false | ||
|
||
status-level = "skip" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,10 +117,17 @@ jobs: | |
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-nextest | ||
- name: "Install cargo insta" | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-insta | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Run tests" | ||
shell: bash | ||
run: cargo nextest run --workspace --status-level skip --failure-output immediate-final --no-fail-fast -j 12 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you benchmark it? It seemed like it was about 30s faster for WIndows (#9921 (comment)). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not but you mentioned on your PR that it is minimal 😆
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lol you got me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ended up keeping it because the Windows difference was kinda big though... |
||
env: | ||
NEXTEST_PROFILE: "ci" | ||
run: cargo insta test --all-features --unreferenced reject --test-runner nextest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I didn't know about this, huh. Did you know about this @zanieb? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I talked about this in my earlier pull request I linked :p I think the key here is setting the profile via environment variable? Nice work @MichaReiser |
||
|
||
# Check for broken links in the documentation. | ||
- run: cargo doc --all --no-deps | ||
env: | ||
|
@@ -148,7 +155,9 @@ jobs: | |
- uses: Swatinem/rust-cache@v2 | ||
- name: "Run tests" | ||
shell: bash | ||
run: cargo nextest run --workspace --status-level skip --failure-output immediate-final --no-fail-fast -j 12 | ||
run: | | ||
cargo nextest run --all-features --profile ci | ||
cargo test --all-features --doc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this on the Windows tests? If anything, shouldn't it only be on the Linux tests, since doctests add so much overhead, and Windows is the bottleneck? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So the doctests run on both Windows and Linux. However, we never used the unreferenced-snapshots feature on Windows, so it felt useless to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah that makes sense, thanks! Doctests are so slow, honestly I'm tempted not to run them on Windows. |
||
cargo-test-wasm: | ||
name: "cargo test (wasm)" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ license = { workspace = true } | |
|
||
[lib] | ||
bench = false | ||
doctest = false | ||
|
||
[[bench]] | ||
name = "linter" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo insta
doesn't support passing custom test runner flags. Luckily, nextest supports setting the profile via environment flag..