summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-02-09 13:33:05 -0700
committerGitHub <noreply@github.com>2024-02-09 13:33:05 -0700
commitdcbbcd23f5dd8601e2851aded4cabc6557164363 (patch)
treef9c3842b8c80028c6ab8e298a4d08ac828eff11d /.github/workflows
parent24bdc1de33494bc1619bfebea826ab08ffb74a01 (diff)
refactor: split integration tests from CLI (part 1) (#22308)
This PR separates integration tests from CLI tests into a new project named `cli_tests`. This is a prerequisite for an integration test runner that can work with either the CLI binary in the current project, or one that is built ahead of time. ## Background Rust does not have the concept of artifact dependencies yet (https://github.com/rust-lang/cargo/issues/9096). Because of this, the only way we can ensure a binary is built before running associated tests is by hanging tests off the crate with the binary itself. Unfortunately this means that to run those tests, you _must_ build the binary and in the case of the deno executable that might be a 10 minute wait in release mode. ## Implementation To allow for tests to run with and without the requirement that the binary is up-to-date, we split the integration tests into a project of their own. As these tests would not require the binary to build itself before being run as-is, we add a stub integration `[[test]]` target in the `cli` project that invokes these tests using `cargo test`. The stub test runner we add has `harness = false` so that we can get access to a `main` function. This `main` function's sole job is to `execvp` the command `cargo test -p deno_cli`, effectively "calling" another cargo target. This ensures that the deno executable is always correctly rebuilt before running the stub test runner from `cli`, and gets us closer to be able to run the entire integration test suite on arbitrary deno executables (and therefore split the build into multiple phases). The new `cli_tests` project lives within `cli` to avoid a large PR. In later PRs, the test data will be split from the `cli` project. As there are a few thousand files, it'll be better to do this as a completely separate PR to avoid noise.
Diffstat (limited to '.github/workflows')
-rwxr-xr-x.github/workflows/ci.generate.ts2
-rw-r--r--.github/workflows/ci.yml2
2 files changed, 2 insertions, 2 deletions
diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts
index e47435b7e..26ca89316 100755
--- a/.github/workflows/ci.generate.ts
+++ b/.github/workflows/ci.generate.ts
@@ -791,7 +791,7 @@ const ci = {
// Run unit then integration tests. Skip doc tests here
// since they are sometimes very slow on Mac.
"cargo test --locked --lib",
- "cargo test --locked --test '*'",
+ "cargo test --locked --tests",
].join("\n"),
env: { CARGO_PROFILE_DEV_DEBUG: 0 },
},
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 63a87d059..79edd24c5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -480,7 +480,7 @@ jobs:
(startsWith(github.ref, 'refs/tags/') || matrix.os != 'linux'))
run: |-
cargo test --locked --lib
- cargo test --locked --test '*'
+ cargo test --locked --tests
env:
CARGO_PROFILE_DEV_DEBUG: 0
- name: Test (release)