Skip to content

Commit

Permalink
internal: Add test utils crate. (#476)
Browse files Browse the repository at this point in the history
* Start on new crate.

* Add config.

* Apply to vcs.

* Apply to utils.

* Apply to task.

* Apply to runner.

* Apply to generator.

* Apply to cache.

* Apply to archive.

* Apply to langs/platforms.

* Migrate more.

* Apply to config.

* Apply to project.

* Apply to project graph.

* Migrate bin/check.

* Migrate dep_graph.

* Migrate docker.

* Migrate generate.

* Migrate init_node.

* Migrate init.

* Migrate migrate.

* Migrate node.

* Migrate project_graph.

* Migrate project.

* Migrate query.

* Migrate setup/sync.

* Migrate run_webhooks.

* Migrate node.

* Migrate run_system.

* Migrate run.

* Remove test file.

* Collapse deps.

* Update gh cache.

* Add schemas to docs.

* Remove old fixtures.

* First pass.

* Fix tests.

* Polish tests.

* Fix windows snapshot.

* Update yarn.

* Update writing.

* More polish.

* Debug.

* Another attempt.

* Fix slashes.

* Fix windows issues.
  • Loading branch information
milesj committed Nov 29, 2022
1 parent 5a45796 commit c0c5c55
Show file tree
Hide file tree
Showing 183 changed files with 4,236 additions and 3,697 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:
with:
toolchain: 1.65.0
profile: minimal
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: benchmark
- name: Run benchmarks
uses: actions-rs/cargo@v1
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:
toolchain: 1.65.0
profile: minimal
- uses: Swatinem/rust-cache@v2
with:
shared-key: moon
- uses: moonrepo/tool-version-action@v1
with:
node: ${{ matrix.node-version }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
target: ${{ matrix.target }}
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: moon
- name: Generate lockfile
uses: actions-rs/cargo@v1
if: ${{ !matrix.docker-target }}
Expand Down Expand Up @@ -159,6 +161,8 @@ jobs:
check-latest: true
node-version: 16
- uses: Swatinem/rust-cache@v2
with:
shared-key: moon
- name: Setup toolchain
if: ${{ matrix.setup }}
run: ${{ matrix.setup }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
shared-key: format
- uses: actions-rs/cargo@v1
name: Check formatting
with:
Expand All @@ -50,6 +52,8 @@ jobs:
profile: minimal
components: clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: lint
- uses: davidB/rust-cargo-make@v1
- name: Run linter
run: cargo make lint
Expand All @@ -70,6 +74,8 @@ jobs:
components: llvm-tools-preview
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: test
- name: Install cargo-make
uses: davidB/rust-cargo-make@v1
- name: Install nextest
Expand Down
51 changes: 31 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ default-members = ["crates/cli"]
cached = "0.40.0"
clap = "4.0.23"
criterion = { version = "0.4.0", features = ["async_tokio"] }
insta = "1.21.1"
reqwest = "0.11.12"
rustc-hash = "1.1.0"
serde = { version = "1.0.145", features = ["derive"] }
Expand Down
5 changes: 1 addition & 4 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ tokio = { workspace = true }
moon_archive = { path = "../core/archive" }
moon_cache = { path = "../core/cache" }
moon_notifier = { path = "../core/notifier" }
assert_cmd = "2.0.6"
insta = { workspace = true }
predicates = "2.1.3"
pretty_assertions = "1.3.0"
moon_test_utils = { path = "../core/test-utils" }
serial_test = "0.9.0"
wiremock = "0.5.15"
2 changes: 1 addition & 1 deletion crates/cli/src/commands/init/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ pub async fn init(
#[cfg(test)]
mod tests {
use super::*;
use insta::assert_snapshot;
use moon_test_utils::assert_snapshot;

#[test]
fn renders_default() {
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/init/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ pub async fn init_node(
#[cfg(test)]
mod tests {
use super::*;
use insta::assert_snapshot;
use moon_test_utils::assert_snapshot;

#[test]
fn renders_default() {
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/init/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub async fn init_typescript(
#[cfg(test)]
mod tests {
use super::*;
use insta::assert_snapshot;
use moon_test_utils::assert_snapshot;

#[test]
fn renders_default() {
Expand Down
Loading

0 comments on commit c0c5c55

Please sign in to comment.