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

ci: add cargo test reporting #56

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

ci: add cargo test reporting #56

wants to merge 3 commits into from

Conversation

marijanp
Copy link
Collaborator

No description provided.

@marijanp marijanp self-assigned this Mar 29, 2024
@@ -41,7 +41,7 @@
];
perSystem = { config, self', inputs', system, pkgs, lib, ... }:
let
rustToolchain = inputs'.fenix.packages.stable.toolchain;
rustToolchain = inputs'.fenix.packages.latest.toolchain;
Copy link
Contributor

@koxu1996 koxu1996 Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to avoid using nigthly toolchain.

@@ -83,6 +83,11 @@

kairos = craneLib.buildPackage (kairosNodeAttrs // {
cargoArtifacts = self'.packages.kairos-deps;
cargoTestExtraArgs = "-- -Z unstable-options --format json --report-time | tee test-output.json";
Copy link
Contributor

@koxu1996 koxu1996 Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cargoTestExtraArgs = "-- -Z unstable-options --format json --report-time | tee test-output.json";
cargoTestExtraArgs = "-- --format json --report-time | tee test-output.json";

Would this work?

Edit: Okay, I see cargo test has no structured output without unstable option to get JSON 😨 .


- name: Create JUnit Kairos Test Report x86_64-linux
if: matrix.os == 'ubuntu-latest'
run: cat kairos-result/test-result.json | nix run nixpkgs#cargo2junit > kairos-test-result.xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using cargo2junit forces us to use nigthly toolchain 😞.

What about using cargo nextest instead of default cargo test runner? Nextest has JUnit output and it was designed for usage in CI.

@marijanp marijanp marked this pull request as draft April 3, 2024 14:40
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 this pull request may close these issues.

None yet

3 participants