mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-11-22 12:55:13 +00:00
Run shell tests in a clean env
This commit is contained in:
parent
753d95e5a4
commit
14b150c1f7
1
.github/workflows/cargo-audit.yml
vendored
1
.github/workflows/cargo-audit.yml
vendored
@ -19,4 +19,5 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions-rs/audit-check@v1
|
- uses: actions-rs/audit-check@v1
|
||||||
with:
|
with:
|
||||||
|
args: --color=always
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
2
.github/workflows/cargo-clippy.yml
vendored
2
.github/workflows/cargo-clippy.yml
vendored
@ -20,5 +20,5 @@ jobs:
|
|||||||
components: clippy
|
components: clippy
|
||||||
- uses: actions-rs/clippy-check@v1
|
- uses: actions-rs/clippy-check@v1
|
||||||
with:
|
with:
|
||||||
args: --all-targets --all-features -- -D warnings -D clippy::all
|
args: --all-targets --all-features --color=always -- -D warnings -D clippy::all
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
2
.github/workflows/cargo-fmt.yml
vendored
2
.github/workflows/cargo-fmt.yml
vendored
@ -18,4 +18,4 @@ jobs:
|
|||||||
- uses: actions-rs/cargo@v1
|
- uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: fmt
|
command: fmt
|
||||||
args: -- --check
|
args: -- --check --color=always
|
||||||
|
6
.github/workflows/cargo-test.yml
vendored
6
.github/workflows/cargo-test.yml
vendored
@ -14,12 +14,12 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v12
|
- uses: cachix/install-nix-action@v12
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-stable
|
||||||
# - uses: cachix/cachix-action@v8
|
# - uses: cachix/cachix-action@v8
|
||||||
# with:
|
# with:
|
||||||
# name: zoxide
|
# name: zoxide
|
||||||
# authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
# authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
- run: nix-shell --run "cargo test --no-fail-fast"
|
- run: nix-shell --pure --run "cargo test --all-features --all-targets --color=always --no-fail-fast"
|
||||||
test-windows:
|
test-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
@ -32,4 +32,4 @@ jobs:
|
|||||||
- uses: actions-rs/cargo@v1
|
- uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --all-features --no-fail-fast
|
args: --all-features --all-targets --color=always --no-fail-fast
|
||||||
|
2
.github/workflows/cargo-udeps.yml
vendored
2
.github/workflows/cargo-udeps.yml
vendored
@ -22,4 +22,4 @@ jobs:
|
|||||||
crate: cargo-udeps
|
crate: cargo-udeps
|
||||||
version: latest
|
version: latest
|
||||||
use-tool-cache: true
|
use-tool-cache: true
|
||||||
- run: cargo udeps --all-features --all-targets
|
- run: cargo udeps --all-features --all-targets --color=always
|
||||||
|
12
src/shell.rs
12
src/shell.rs
@ -104,7 +104,7 @@ mod tests {
|
|||||||
let opts = dbg!(&opts()[i]);
|
let opts = dbg!(&opts()[i]);
|
||||||
let source = Bash(opts).render().unwrap();
|
let source = Bash(opts).render().unwrap();
|
||||||
Command::new("bash")
|
Command::new("bash")
|
||||||
.args(&["-c", &source])
|
.args(&["-c", &source, "--noediting", "--noprofile", "--norc"])
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout("")
|
.stdout("")
|
||||||
@ -145,7 +145,7 @@ mod tests {
|
|||||||
let opts = dbg!(&opts()[i]);
|
let opts = dbg!(&opts()[i]);
|
||||||
let source = Fish(opts).render().unwrap();
|
let source = Fish(opts).render().unwrap();
|
||||||
Command::new("fish")
|
Command::new("fish")
|
||||||
.args(&["-c", &source])
|
.args(&["--command", &source, "--private"])
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout("")
|
.stdout("")
|
||||||
@ -159,7 +159,7 @@ mod tests {
|
|||||||
let opts = dbg!(&opts()[i]);
|
let opts = dbg!(&opts()[i]);
|
||||||
let source = Posix(opts).render().unwrap();
|
let source = Posix(opts).render().unwrap();
|
||||||
let assert = Command::new("bash")
|
let assert = Command::new("bash")
|
||||||
.args(&["--posix", "-c", &source])
|
.args(&["--posix", "-c", &source, "--noediting", "--noprofile", "--norc"])
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stderr("");
|
.stderr("");
|
||||||
@ -218,7 +218,7 @@ mod tests {
|
|||||||
let opts = dbg!(&opts()[i]);
|
let opts = dbg!(&opts()[i]);
|
||||||
let source = PowerShell(opts).render().unwrap();
|
let source = PowerShell(opts).render().unwrap();
|
||||||
Command::new("pwsh")
|
Command::new("pwsh")
|
||||||
.args(&["-c", &source])
|
.args(&["-Command", &source, "-NoLogo", "-NonInteractive", "-NoProfile"])
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout("")
|
.stdout("")
|
||||||
@ -269,7 +269,7 @@ mod tests {
|
|||||||
let opts = dbg!(&opts()[i]);
|
let opts = dbg!(&opts()[i]);
|
||||||
let source = Xonsh(opts).render().unwrap();
|
let source = Xonsh(opts).render().unwrap();
|
||||||
Command::new("xonsh")
|
Command::new("xonsh")
|
||||||
.args(&["-c", &source])
|
.args(&["-c", &source, "--no-rc"])
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout("")
|
.stdout("")
|
||||||
@ -281,7 +281,7 @@ mod tests {
|
|||||||
let opts = dbg!(&opts()[i]);
|
let opts = dbg!(&opts()[i]);
|
||||||
let source = Zsh(opts).render().unwrap();
|
let source = Zsh(opts).render().unwrap();
|
||||||
Command::new("zsh")
|
Command::new("zsh")
|
||||||
.args(&["-c", &source])
|
.args(&["-c", &source, "--no-rcs"])
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout("")
|
.stdout("")
|
||||||
|
Loading…
Reference in New Issue
Block a user