0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-04 13:47:27 -05:00
denoland-deno/cli/tests/Cargo.toml
Matt Mastracci dcbbcd23f5
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.
2024-02-09 13:33:05 -07:00

51 lines
1.2 KiB
TOML

# Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
[package]
name = "cli_tests"
version = "0.0.0"
authors.workspace = true
autotests = false
edition.workspace = true
license.workspace = true
repository.workspace = true
[lib]
path = "lib.rs"
[features]
run = []
[[test]]
name = "integration_tests"
path = "integration_tests.rs"
required-features = ["run"]
[dev-dependencies]
bytes.workspace = true
deno_ast.workspace = true
deno_bench_util.workspace = true
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting", "unsafe_use_unprotected_platform"] }
deno_fetch.workspace = true
deno_lockfile.workspace = true
deno_tls.workspace = true
fastwebsockets = { workspace = true, features = ["upgrade", "unstable-split"] }
flaky_test = "=0.1.0"
http.workspace = true
http-body-util.workspace = true
hyper.workspace = true
hyper-util.workspace = true
once_cell.workspace = true
os_pipe.workspace = true
pretty_assertions.workspace = true
serde.workspace = true
serde_repr.workspace = true
test_util.workspace = true
tokio.workspace = true
tokio-util.workspace = true
tower-lsp.workspace = true
trust-dns-client = "=0.22.0"
trust-dns-server = "=0.22.1"
url.workspace = true
[target.'cfg(unix)'.dev-dependencies]
nix.workspace = true