Skip to content

Commit

Permalink
fix some nits in CI (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahl authored Dec 18, 2024
1 parent 71c40c9 commit 02d36bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
check-style:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@v4
- name: Report cargo version
run: cargo --version
- name: Report rustfmt version
Expand All @@ -24,7 +24,7 @@ jobs:
clippy-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@v4
- name: Report cargo version
run: cargo --version
- name: Report Clippy version
Expand All @@ -38,13 +38,11 @@ jobs:
check-generation:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@v4
- name: Install nightly rustfmt
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt
default: false
- name: Report cargo version
run: cargo --version
- name: Report rustc version
Expand All @@ -62,7 +60,7 @@ jobs:
- features: all
feature_flags: --all-features
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@v4
- name: Report cargo version
run: cargo --version
- name: Report rustc version
Expand Down
9 changes: 5 additions & 4 deletions cli/tests/test_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ use serde_json::json;
fn scrub_server(raw: String, server: String) -> String {
raw.replace(&server, "<TEST-SERVER>")
}
fn scrub_creds(raw: String, path: &Path) -> String {
let path = path.to_string_lossy().to_string();
raw.replace(&path, "<CREDENTIALS-PATH>")
}
struct MockOAuth<'a> {
device_auth: Mock<'a>,
device_token: Mock<'a>,
Expand Down Expand Up @@ -337,6 +333,11 @@ fn test_auth_credentials_permissions() {
.success();
let stderr = String::from_utf8_lossy(&cmd.get_output().stderr);

fn scrub_creds(raw: String, path: &Path) -> String {
let path = path.to_string_lossy().to_string();
raw.replace(&path, "<CREDENTIALS-PATH>")
}

assert_contents(
"tests/data/test_auth_credentials_permissions.stderr",
&scrub_creds(stderr.to_string(), &cred_path),
Expand Down

0 comments on commit 02d36bb

Please sign in to comment.