Integration tests are immune to `cargo update`
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
_TLDR: A `cargo update` in the root folder does not update the `bevy/tests-integration/simple-ecs-state` crate. This means CI can get stuck in a failing state, and the fix is not obvious._
## Bevy version
8f08d6b
## Relevant system information
Win10, cargo 1.87.0 (99624be96 2025-05-06).
## What you did
`cargo run -p ci` - the intention was to check CI while working on a PR.
## What went wrong
```
> cargo test --manifest-path C:\[redacted]\bevy\./tests-integration\simple-ecs-test/Cargo.toml --tests --
error: failed to select a version for `coreaudio-sys`.
```
Expand for full error.
```
error: failed to select a version for `coreaudio-sys`.
... required by package `coreaudio-rs v0.11.3`
... which satisfies dependency `coreaudio-rs = "^0.11"` (locked to 0.11.3) of package `cpal v0.15.3`
... which satisfies dependency `cpal = "^0.15"` (locked to 0.15.3) of package `bevy_audio v0.16.0-dev (/mnt/data/Code/bevy_fork/crates/bevy_audio)`
... which satisfies path dependency `bevy_audio` (locked to 0.16.0-dev) of package `bevy_internal v0.16.0-dev (/mnt/data/Code/bevy_fork/crates/bevy_internal)`
... which satisfies path dependency `bevy_internal` (locked to 0.16.0-dev) of package `bevy v0.16.0-dev (/mnt/data/Code/bevy_fork)`
... which satisfies path dependency `bevy` (locked to 0.16.0-dev) of package `simple-ecs-test v0.0.0 (/mnt/data/Code/bevy_fork/tests-integration/simple-ecs-test)`
versions that meet the requirements `^0.2` (locked to 0.2.16) are: 0.2.16
all possible versions conflict with previously selected packages.
previously selected package `coreaudio-sys v0.2.17`
... which satisfies dependency `coreaudio-sys = "^0.2.17"` of package `bevy_audio v0.16.0-dev (/mnt/data/Code/bevy_fork/crates/bevy_audio)`
... which satisfies path dependency `bevy_audio` (locked to 0.16.0-dev) of package `bevy_internal v0.16.0-dev (/mnt/data/Code/bevy_fork/crates/bevy_internal)`
... which satisfies path dependency `bevy_internal` (locked to 0.16.0-dev) of package `bevy v0.16.0-dev (/mnt/data/Code/bevy_fork)`
... which satisfies path dependency `bevy` (locked to 0.16.0-dev) of package `simple-ecs-test v0.0.0 (/mnt/data/Code/bevy_fork/tests-integration/simple-ecs-test)`
failed to select a version for `coreaudio-sys` which could resolve this conflict
```
I guessed it was something that might go away after a `cargo update`, but it didn't.
Later I found a [discord comment](https://discord.com/channels/691052431525675048/692572690833473578/1383799459833581599), and the fix was to follow its suggestion of a `cargo update` inside `tests-integration/simple-ecs-test` rather than the Bevy root folder.
My assumption is that these kind of transient crate versioning errors are a fact of life and not a Bevy problem as such. The Bevy problem is that I expected a `cargo update` to fix things and it didn't. It didn't fix things because a `cargo update` in the root folder doesn't know to update `tests-integration/simple-ecs-test`.
## Can you suggest a fix?
I don't know enough about Cargo to be confident, but I'm assuming it's not possible for a `cargo update` in the Bevy folder to be aware of the integration tests - the point of these tests is to simulate an entirely independent crate.
I did notice that CI already cleans the integration test crates _after_ the tests: https://github.com/bevyengine/bevy/blob/8f08d6bc860a14866164e65ce38015c14f4e1c14/tools/ci/src/ci.rs#L80-L86
Perhaps the solution is to do a clean and update _before_ the tests? Which seems presumptuous, but I haven't thought of a better option.
Contributor guide
Assessment
This issue has not been assessed yet.