Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
reubeno committed Oct 26, 2024
1 parent 936478e commit 827a809
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,17 @@ jobs:
# Test release binary on a variety of OS platforms.
os-tests:
name: "OS tests"
strategy:
fail-fast: false
matrix:
include:
- container: "fedora:latest"
description: "Fedora [latest]"
prereqs_command: "dnf install -y bash-completion iputils grep less sed"

name: "OS tests (${{ matrix.description }})"
runs-on: ubuntu-latest
container: fedora:latest
container: ${{ matrix.container }}
needs: build
steps:
# Checkout sources for YAML-based test cases
Expand All @@ -356,16 +364,20 @@ jobs:
run: |
set -euxo pipefail
chmod +x binaries/*
ls -l -R sources/brush-shell/tests
ls -l binaries
- name: Install prerequisites
run: dnf install -y bash-completion
if: ${{ matrix.prereqs_command != '' }}
run: ${{ matrix.prereqs_command }}

- name: Run tests
run: |
export CARGO_TARGET_DIR=binaries
export CARGO_BIN_EXE_brush=binaries/brush
export CARGO_MANIFEST_DIR=sources/brush-shell
export CARGO_TARGET_DIR=$PWD/binaries
export CARGO_BIN_EXE_brush=$PWD/binaries/brush
export CARGO_MANIFEST_DIR=$PWD/sources/brush-shell
export BRUSH_VERBOSE=true
result=0
for test_name in binaries/*tests*; do
Expand Down
2 changes: 1 addition & 1 deletion brush-shell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async-trait = "0.1.83"
brush-parser = { version = "^0.2.9", path = "../brush-parser" }
brush-core = { version = "^0.2.11", path = "../brush-core" }
cfg-if = "1.0.0"
clap = { version = "4.5.17", features = ["derive", "wrap_help"] }
clap = { version = "4.5.17", features = ["derive", "env", "wrap_help"] }
const_format = "0.2.33"
git-version = "0.3.9"
lazy_static = "1.5.0"
Expand Down
10 changes: 8 additions & 2 deletions brush-shell/tests/compat_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@ async fn cli_integration_tests(options: TestOptions) -> Result<()> {
test_configs.push(TestConfig::for_sh_testing(&options)?);
}

let glob_pattern = format!("{dir}/tests/cases/**/*.yaml");

if options.verbose {
eprintln!("Running tests cases: {glob_pattern}");
}

// Spawn each test case set separately.
for entry in glob::glob(format!("{dir}/tests/cases/**/*.yaml").as_ref()).unwrap() {
for entry in glob::glob(glob_pattern.as_ref()).unwrap() {
let entry = entry.unwrap();

let yaml_file = std::fs::File::open(entry.as_path())?;
Expand Down Expand Up @@ -1282,7 +1288,7 @@ struct TestOptions {
pub display_known_failure_details: bool,

/// Display details regarding successful test cases
#[clap(short = 'v', long = "verbose")]
#[clap(short = 'v', long = "verbose", env = "BRUSH_VERBOSE")]
pub verbose: bool,

/// Enable a specific configuration
Expand Down

0 comments on commit 827a809

Please sign in to comment.