axodotdev / axodotdev/cargo-dist
CLI tests broken while building from source tarball
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 149
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 32
Description
I have apparently been beaten to the punch by minutes on updating it in nixpkgs, but I just noticed this also: https://github.com/NixOS/nixpkgs/pull/281911
cc @mistydemeo
`cargo-dist/tests/cli-tests.rs` depends on a Git repo being present and fails with the following errors, for example:
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot file: cargo-dist/tests/snapshots/error_manifest.snap
Snapshot: error_manifest
Source: cargo-dist/tests/cli-tests.rs:169
────────────────────────────────────────────────────────────────────────────────
Expression: format_outputs(&output)
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
0 0 │ stdout:
1 1 │ {"diagnostic": {"message": "This workspace doesn't have anything for cargo-dist to Release!","severity": "error","causes>
2 2 │
3 3 │ stderr:
4 │+ WARN skipping source tarball; no git repo found at /build/source
4 5 │ × This workspace doesn't have anything for cargo-dist to Release!
5 6 │ help: You may need to pass the current version as --tag, or need to give all your packages the same version
6 7 │
7 8 │ Here are some options:
────────────┴───────────────────────────────────────────────────────────────────
To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.
```
Contributor guide
Research direction
Start with cargo-dist/tests/cli-tests.rs, especially the case at line 169, and compare it with cargo-dist/tests/snapshots/error_manifest.snap. Run the CLI snapshot tests with `cargo insta test` from a source tarball that has no Git repository. Done means the tests no longer depend on Git metadata and the affected snapshots pass without the reported warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, cli, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100