From 033cb52e6ff6032fe6d84837cabc5da39050cde3 Mon Sep 17 00:00:00 2001 From: "Valeriy V. Vorotyntsev" Date: Sun, 8 Oct 2023 23:59:25 +0300 Subject: [PATCH] XXX-DELETEME --- .github/workflows/check.yml | 92 ------------------------------------- .github/workflows/test.yml | 51 ++++---------------- rust/ja4/Cargo.toml | 1 + rust/ja4/src/lib.rs | 2 + 4 files changed, 11 insertions(+), 135 deletions(-) delete mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index 9bb449e..0000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,92 +0,0 @@ -# Borrowed from https://github.com/jonhoo/rust-ci-conf/blob/6332a3af21a58f811a681a98cd44d0f5da8a1891/.github/workflows/check.yml -# See the [screencast] by Jon Gjengset. -# -# [screencast]: https://www.youtube.com/watch?v=xUH-4y92jPg - -name: check - -permissions: - contents: read - -on: - push: - branches: [main] - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - fmt: - name: stable / fmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - name: cargo fmt --check --all - run: cargo fmt --check --all - working-directory: rust/ - - clippy: - name: ${{ matrix.toolchain }} / clippy - runs-on: ubuntu-latest - permissions: - contents: read - checks: write - strategy: - fail-fast: false - matrix: - toolchain: [stable, beta] - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install ${{ matrix.toolchain }} - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.toolchain }} - components: clippy - - name: cargo clippy - uses: actions-rs/clippy-check@v1 - with: - # Github Actions don't support `working-dir` in the `uses` context. - # Specify `--manifest-path` as a workaround. - # - # See https://github.com/actions-rs/clippy-check/issues/28 - args: --all-features --workspace --manifest-path rust/Cargo.toml - token: ${{ secrets.GITHUB_TOKEN }} - - doc: - name: nightly / doc - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install nightly - uses: dtolnay/rust-toolchain@nightly - - name: cargo doc - run: cargo doc --no-deps --all-features --document-private-items --workspace - working-directory: rust/ - - hack: - name: ubuntu / stable / features - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - name: cargo install cargo-hack - uses: taiki-e/install-action@cargo-hack - # Intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 - - name: cargo hack - run: cargo hack --feature-powerset --workspace check - working-directory: rust/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7ed5e8..ab42158 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - toolchain: [stable, beta] + toolchain: [stable] + #XXX toolchain: [stable, beta] steps: - uses: actions/checkout@v4 with: @@ -36,50 +37,14 @@ jobs: if: hashFiles('rust/Cargo.lock') == '' # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test - run: cargo test --locked --all-features --all-targets --workspace + run: | + echo XXX; pwd + echo XXX; ls -l + echo XXX; ls -l .. + echo XXX; ls -l ../pcap/ || true + cargo test --locked --all-features --all-targets --workspace -- --nocapture working-directory: rust/ # https://github.com/rust-lang/cargo/issues/6669 - name: cargo test --doc run: cargo test --locked --all-features --doc --workspace working-directory: rust/ - - minimal: - name: ubuntu / stable / minimal-versions - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - name: Install nightly for -Zminimal-versions - uses: dtolnay/rust-toolchain@nightly - - run: rustup default stable - - run: cargo +nightly update -Zminimal-versions --workspace - working-directory: rust/ - - run: cargo test --locked --all-features --all-targets --workspace - working-directory: rust/ - - os-check: - name: ${{ matrix.os }} / stable - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - # NOTE: Don't use GitHub-hosted macOS runners in a non-public repository -- - # they consume CI/CD minutes like crazy; see - # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#minute-multipliers - - windows-latest - #- macos-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - run: cargo generate-lockfile - if: hashFiles('rust/Cargo.lock') == '' - - name: cargo test - run: cargo test --locked --all-features --all-targets --workspace - working-directory: rust/ diff --git a/rust/ja4/Cargo.toml b/rust/ja4/Cargo.toml index c400581..c056f10 100644 --- a/rust/ja4/Cargo.toml +++ b/rust/ja4/Cargo.toml @@ -35,5 +35,6 @@ tracing-subscriber.workspace = true [dev-dependencies] expect-test = "1.4" +fs-err.workspace = true # XXX-DELETEME insta = { version = "1.33", features = ["glob", "yaml"] } pretty_assertions = "1.4" diff --git a/rust/ja4/src/lib.rs b/rust/ja4/src/lib.rs index b3fc9dd..c30be58 100644 --- a/rust/ja4/src/lib.rs +++ b/rust/ja4/src/lib.rs @@ -216,6 +216,8 @@ fn test_insta() { concat!(env!("CARGO_MANIFEST_DIR"), "/../.."), "pcap/*.pcap*", |path| { + dbg!(("XXX", std::env::current_dir().unwrap(), path)); + let _f = fs_err::File::open(path).unwrap(); let cli = Cli { json: false, with_raw: false,