diff --git a/earthly/rust/scripts/std_build.py b/earthly/rust/scripts/std_build.py index aad1bd04..6912b87a 100755 --- a/earthly/rust/scripts/std_build.py +++ b/earthly/rust/scripts/std_build.py @@ -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) @@ -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)