Skip to content

Commit

Permalink
fix(rust): Run doctests serially, to prevent flaky builds from failed…
Browse files Browse the repository at this point in the history
… doctest compiles
  • Loading branch information
stevenj committed Jan 3, 2025
1 parent dd42519 commit 21127dd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions earthly/rust/scripts/std_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,8 @@ def main():
runner.run(cargo_lint, args.lint_flags, args.verbose)

# Check if all Self contained tests pass (Test that need no external resources).
# But NOT doc tests, as these are not replacements for unit tests.
if not args.disable_tests:
# Check if all documentation tests pass.
runner.run(cargo_doctest, args.doctest_flags, args.verbose)
if args.cov_report == "":
# Without coverage report
runner.run(cargo_nextest, args.test_flags, args.verbose)
Expand Down Expand Up @@ -367,6 +366,15 @@ def main():

results = runner.get_results()

# Check if all Self contained doc tests pass (Test that need no external resources).
# Can not be run in parallel with the normal builds as it becomes flaky and randomly fails.
# NOTE: DocTests are ONLY run to prove they are valid, they are NOT unit tests, and never
# currently contribute to code coverage.
if not args.disable_tests:
# Check if all documentation tests pass.
results.add(cargo_doctest(args.doctest_flags, args.verbose))


results.print()
if not results.ok():
exit(1)
Expand Down

0 comments on commit 21127dd

Please sign in to comment.