Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ test-threads = 1

[profile.ci-provider-integration.junit]
path = "junit.xml"

# profile for running the MBOR types smoke tests against the emu backend
# (in-process firmware).
[profile.ci-mbor-smoke.junit]
path = "junit.xml"
83 changes: 83 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,50 @@ jobs:
echo "One or more tests failed."
exit 1

test_ubuntu_smoke:

runs-on: ubuntu-24.04

defaults:
run:
working-directory: .

steps:
- uses: actions/checkout@v6
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libbsd-dev

- name: Restore Cargo cache
id: cargo-cache
uses: actions/cache/restore@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ env.CACHE_KEY_ID }}
- name: Setup
if: steps.cargo-cache.outputs.cache-hit != 'true'
run: cargo xtask setup
Comment thread
Copilot marked this conversation as resolved.
Outdated
- name: Run emu smoke tests
id: test-emu-smoke
run: cargo xtask precheck --nextest --package azihsm_ddi_mbor_types --features emu --test azihsm_ddi_tests --filter smoke
continue-on-error: true
Comment thread
zimmy87 marked this conversation as resolved.
- name: Generate nextest report
id: nextest-report
run: cargo xtask precheck --nextest-report
- name: Code Coverage Summary Report
if: ${{ steps.test-emu-smoke.outcome == 'success' }}
run: cargo xtask precheck --coverage-report
Comment thread
Copilot marked this conversation as resolved.
Outdated
- name: Fail if any tests failed
if: ${{ steps.test-emu-smoke.outcome == 'failure' }}
run: |
echo "One or more tests failed."
exit 1

build_windows:

runs-on: windows-2025-vs2026
Expand Down Expand Up @@ -145,3 +189,42 @@ jobs:
run: |
echo "One or more tests failed."
exit 1

test_windows_smoke:

runs-on: windows-2025-vs2026

defaults:
run:
working-directory: .

steps:
- uses: actions/checkout@v6
- name: Restore Cargo cache
id: cargo-cache
uses: actions/cache/restore@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ env.CACHE_KEY_ID }}
- name: Setup
if: steps.cargo-cache.outputs.cache-hit != 'true'
run: cargo xtask setup
- name: Run emu smoke tests
id: test-emu-smoke
run: cargo xtask precheck --nextest --package azihsm_ddi_mbor_types --features emu --test azihsm_ddi_tests --filter smoke
continue-on-error: true
- name: Generate nextest report
id: nextest-report
run: cargo xtask precheck --nextest-report
- name: Code Coverage Summary Report
if: ${{ steps.test-emu-smoke.outcome == 'success' }}
run: cargo xtask precheck --coverage-report
Comment thread
Copilot marked this conversation as resolved.
Outdated
- name: Fail if any tests failed
if: ${{ steps.test-emu-smoke.outcome == 'failure' }}
run: |
echo "One or more tests failed."
exit 1
2 changes: 2 additions & 0 deletions xtask/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ impl Xtask for IntegrationTest {
filterset: None,
profile: Some("ci-provider-integration".to_string()),
exclude: vec![],
test: None,
filter: vec![],
}
.run(ctx)
};
Expand Down
16 changes: 16 additions & 0 deletions xtask/src/nextest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ pub struct Nextest {
/// Crates to exclude from nextest (e.g. crates with heavyweight build scripts)
#[clap(long)]
pub exclude: Vec<String>,

/// Test only the specified test target
#[clap(long)]
pub test: Option<String>,

/// Test name filters
#[clap(long)]
pub filter: Vec<String>,
}

impl Xtask for Nextest {
Expand Down Expand Up @@ -97,6 +105,14 @@ impl Xtask for Nextest {
command_args.push(val);
}
}
let test_val = self.test.clone().unwrap_or_default();
if self.test.is_some() {
command_args.push("--test");
command_args.push(&test_val);
}
if !self.filter.is_empty() {
command_args.extend(self.filter.iter().map(|s| s.as_str()));
}
Comment thread
zimmy87 marked this conversation as resolved.

cmd!(
sh,
Expand Down
33 changes: 33 additions & 0 deletions xtask/src/precheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ pub struct Precheck {
/// Only used for --setup ignored otherwise.
#[clap(long)]
pub config: Option<String>,
/// The nextest test target to run
#[clap(long)]
pub test: Option<String>,
/// Test name filters
#[clap(long)]
filter: Vec<String>,
}

impl Xtask for Precheck {
Expand Down Expand Up @@ -180,6 +186,8 @@ impl Xtask for Precheck {
filterset: None,
profile: self.profile.clone().or(Some("ci-mock".to_string())),
exclude: self.exclude.clone(),
test: self.test.clone(),
filter: self.filter.clone(),
}
.run(ctx.clone())?;

Expand All @@ -193,6 +201,23 @@ impl Xtask for Precheck {
filterset: Some("test(resiliency::fault_injection::)".to_string()),
profile: self.profile.clone().or(Some("ci-mock-res".to_string())),
exclude: self.exclude.clone(),
test: self.test.clone(),
filter: self.filter.clone(),
}
.run(ctx.clone())?;
}

// Run MBOR types smoke tests against emu backend
if !self.exclude.iter().any(|e| e == "azihsm_ddi_mbor_types") {
Nextest {
features: Some("emu".to_string()),
package: Some("azihsm_ddi_mbor_types".to_string()),
no_default_features: false,
filterset: None,
profile: self.profile.clone().or(Some("ci-mbor-smoke".to_string())),
exclude: self.exclude.clone(),
test: self.test.clone(),
filter: self.filter.clone(),
}
.run(ctx.clone())?;
}
Comment thread
zimmy87 marked this conversation as resolved.
Outdated
Expand All @@ -207,6 +232,8 @@ impl Xtask for Precheck {
filterset: None,
profile: self.profile.clone().or(Some("ci-mock-table-4".to_string())),
exclude: self.exclude.clone(),
test: self.test.clone(),
filter: self.filter.clone(),
}
.run(ctx.clone())?;

Expand All @@ -221,6 +248,8 @@ impl Xtask for Precheck {
.clone()
.or(Some("ci-mock-table-64".to_string())),
exclude: self.exclude.clone(),
test: self.test.clone(),
filter: self.filter.clone(),
}
.run(ctx.clone())?;

Expand All @@ -233,6 +262,8 @@ impl Xtask for Precheck {
filterset: None,
profile: self.profile.clone().or(Some("ci-tbor-emu".to_string())),
exclude: self.exclude.clone(),
test: self.test.clone(),
filter: self.filter.clone(),
}
.run(ctx.clone())?;
}
Expand All @@ -244,6 +275,8 @@ impl Xtask for Precheck {
filterset: None,
profile: self.profile,
exclude: self.exclude,
test: self.test.clone(),
filter: self.filter.clone(),
Comment thread
zimmy87 marked this conversation as resolved.
}
.run(ctx.clone())?;
}
Expand Down
Loading