Run shell tests in a clean env

This commit is contained in:
Ajeet D'Souza 2020-12-10 03:37:40 +05:30
parent 753d95e5a4
commit 14b150c1f7
6 changed files with 13 additions and 12 deletions

View File

@ -19,4 +19,5 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
with:
args: --color=always
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -20,5 +20,5 @@ jobs:
components: clippy
- uses: actions-rs/clippy-check@v1
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 }}

View File

@ -18,4 +18,4 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
args: -- --check --color=always

View File

@ -14,12 +14,12 @@ jobs:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
nix_path: nixpkgs=channel:nixos-stable
# - uses: cachix/cachix-action@v8
# with:
# name: zoxide
# 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:
runs-on: windows-latest
steps:
@ -32,4 +32,4 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast
args: --all-features --all-targets --color=always --no-fail-fast

View File

@ -22,4 +22,4 @@ jobs:
crate: cargo-udeps
version: latest
use-tool-cache: true
- run: cargo udeps --all-features --all-targets
- run: cargo udeps --all-features --all-targets --color=always

View File

@ -104,7 +104,7 @@ mod tests {
let opts = dbg!(&opts()[i]);
let source = Bash(opts).render().unwrap();
Command::new("bash")
.args(&["-c", &source])
.args(&["-c", &source, "--noediting", "--noprofile", "--norc"])
.assert()
.success()
.stdout("")
@ -145,7 +145,7 @@ mod tests {
let opts = dbg!(&opts()[i]);
let source = Fish(opts).render().unwrap();
Command::new("fish")
.args(&["-c", &source])
.args(&["--command", &source, "--private"])
.assert()
.success()
.stdout("")
@ -159,7 +159,7 @@ mod tests {
let opts = dbg!(&opts()[i]);
let source = Posix(opts).render().unwrap();
let assert = Command::new("bash")
.args(&["--posix", "-c", &source])
.args(&["--posix", "-c", &source, "--noediting", "--noprofile", "--norc"])
.assert()
.success()
.stderr("");
@ -218,7 +218,7 @@ mod tests {
let opts = dbg!(&opts()[i]);
let source = PowerShell(opts).render().unwrap();
Command::new("pwsh")
.args(&["-c", &source])
.args(&["-Command", &source, "-NoLogo", "-NonInteractive", "-NoProfile"])
.assert()
.success()
.stdout("")
@ -269,7 +269,7 @@ mod tests {
let opts = dbg!(&opts()[i]);
let source = Xonsh(opts).render().unwrap();
Command::new("xonsh")
.args(&["-c", &source])
.args(&["-c", &source, "--no-rc"])
.assert()
.success()
.stdout("")
@ -281,7 +281,7 @@ mod tests {
let opts = dbg!(&opts()[i]);
let source = Zsh(opts).render().unwrap();
Command::new("zsh")
.args(&["-c", &source])
.args(&["-c", &source, "--no-rcs"])
.assert()
.success()
.stdout("")