pksunkara / cargo-workspaces

A tool for managing cargo workspaces and their crates, inspired by lerna
MIT License
465 stars 46 forks source link

Test failure while building 0.3.0 #142

Closed orhun closed 8 months ago

orhun commented 8 months ago

I'm getting the following test failure while building cargo-workspaces for 0.3.0:

failures:

---- test_duplicate_package_name stdout ----
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot file: tests/snapshots/create__duplicate_package_name.snap
Snapshot: duplicate_package_name
Source: tests/create.rs:314
────────────────────────────────────────────────────────────────────────────────
Expression: err
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    0     0 │ warning: compiling this new package may not work due to invalid workspace configuration
    1     1 │
    2     2 │ two packages named `dep1` in this workspace:
    3       │-- /Users/pksunkara/Coding/automa/cargo-workspaces/fixtures/create/dep1/Cargo.toml
    4       │-- /Users/pksunkara/Coding/automa/cargo-workspaces/fixtures/create/dep3/Cargo.toml
          3 │+- /build/cargo-workspaces/src/cargo-workspaces-0.3.0/fixtures/create/dep1/Cargo.toml
          4 │+- /build/cargo-workspaces/src/cargo-workspaces-0.3.0/fixtures/create/dep3/Cargo.toml
    5     5 │      Created library `dep1` package
    6     6 │ error: the workspace already contains a package with this name
────────────┴───────────────────────────────────────────────────────────────────
To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.
thread 'test_duplicate_package_name' panicked at /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/insta-1.32.0/src/runtime.rs:563:9:
snapshot assertion for 'duplicate_package_name' failed in line 314
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    test_duplicate_package_name

test result: FAILED. 7 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.61s

error: test failed, to rerun pass `--test create`

I can probably fix this by running this command:

$ sed -i "/Users/pksunkara/Coding/automa|/build/cargo-workspaces/src/|" tests/snapshots/create__duplicate_package_name.snap

But I think it would be nice to find a better solution for the long term.

pksunkara commented 8 months ago

Yeah, we need to fix that properly. But I released 0.3.0 since people don't run tests while installing.

pksunkara commented 8 months ago

This has been fixed already in https://github.com/pksunkara/cargo-workspaces/commit/c52c26d13695792770e6df2de403ab9ad246c113