diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 8fb4215d..c1ac3d74 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -142,6 +142,14 @@ jobs: continue-on-error: true run: python scripts/export_native.py --all --fetch --output-dir "$RUNNER_TEMP/native" + # A pack built without its data directories exits non-zero: it is not + # the pack a user gets. Tests that build packs need the same trees a + # release build has, as deploy-site.yml fetches them. + - name: Fetch the data directories + run: python scripts/refresh_data_dirs.py + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run test suite # No test downloads a release asset: 252 MB files fetched into the # shared cache filled the runner's disk and changed what later tests diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 537e1a0c..7fcb1a9f 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -3514,5 +3514,20 @@ class TheIssueFormListsEveryPlatform(unittest.TestCase): self.assertIn(display, options) + +class TheTestJobHasTheDataTrees(unittest.TestCase): + """Packs built without data directories exit non-zero; the CI test job + had none, and two pack parity tests failed there only.""" + + def test_the_trees_are_fetched_before_the_suite(self): + steps = yaml.safe_load( + (ROOT / ".github" / "workflows" / "validate.yml").read_text() + )["jobs"]["run-tests"]["steps"] + runs = [step.get("run", "") for step in steps] + fetch = next(i for i, run in enumerate(runs) if "refresh_data_dirs.py" in run) + suite = next(i for i, run in enumerate(runs) if "unittest discover" in run) + self.assertLess(fetch, suite) + + if __name__ == "__main__": unittest.main()