Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run all workspace tests in CI (x86-64 Linux) #7392

Closed
drinkcat opened this issue Mar 4, 2025 · 1 comment · Fixed by #7386
Closed

Run all workspace tests in CI (x86-64 Linux) #7392

drinkcat opened this issue Mar 4, 2025 · 1 comment · Fixed by #7386

Comments

@drinkcat
Copy link
Contributor

drinkcat commented Mar 4, 2025

In #7383, we noticed that CI is not running all tests. For example, tests for package uucore are not being run.

I believe the right solution is to run the tests with the --workspace flag:

cargo test --workspace

I did some experiments in #7386, where I first tried to add --workspace unconditionally to the cargo test command.

windows/macos/linux-musl builds are broken: we could try to fix this later (I'll probably file other issues).

Even x86_64-unknown-linux-gnu builds are built using cross. First, the selinux dependency was not met. This could be fixed by adding a Cross.toml file that pulls in libselinux1-dev (see this example). But even then, the problem is that ghcr.io/cross-rs/x86_64-unknown-linux-gnu:0.2.5 is ancient (Ubuntu 16.04),
so the provided libclang is too old, and the build fails with:

  A `libclang` function was called that is not supported by the loaded `libclang` instance.

      called function = `clang_getTranslationUnitTargetInfo`
      loaded `libclang` instance = 3.8.x

  The minimum `libclang` requirement for this particular function can be found here:
  https://docs.rs/clang-sys/latest/clang_sys/clang_getTranslationUnitTargetInfo/index.html

  Instructions for installing `libclang` can be found here:
  https://rust-lang.github.io/rust-bindgen/requirements.html

My current idea is to add a new job to the matrix that uses cargo directly (no cross). But that currently fails with:

error[E0658]: lint reasons are experimental
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/selinux-0.5.0/src/errors.rs:144:24
    |
144 |     #[allow(dead_code, reason = "used by unit tests")]
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #54503 <https://github.com/rust-lang/rust/issues/54503> for more information

For more information about this error, try `rustc --explain E0658`.
@drinkcat
Copy link
Contributor Author

drinkcat commented Mar 4, 2025

#7394 fixes the error above.

Looks like the uucore tests are being run, at the very least:

     Running unittests src/lib/lib.rs (target/x86_64-unknown-linux-gnu/debug/deps/uucore-b0572bc14cb6090b)
running 142 tests

So I think this is good enough. I'll clean up #7386.

drinkcat added a commit to drinkcat/coreutils that referenced this issue Mar 4, 2025
Add a new Linux build that runs without `cross`, and adds
`--workspace` to the cargo test command.

From cargo test documentation, this option "tests all members in
the workspace.". For example, this includes running tests within
the `uucore` package (see uutils#7383).

Fixes uutils#7392.
drinkcat added a commit to drinkcat/coreutils that referenced this issue Mar 4, 2025
Add a new Linux build that runs without `cross`, and adds
`--workspace` to the cargo test command.

From cargo test documentation, this option "tests all members in
the workspace.". For example, this includes running tests within
the `uucore` package (see uutils#7383).

Fixes uutils#7392.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant