Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
Morganamilo committed Nov 5, 2023
1 parent 23236f6 commit 8bd7c5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/paru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: cargo build --locked --features generate

- name: Test
run: sudo -u nobody BUILDDIR=/tmp PKGDEST=/tmp SRCDEST=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features generate,mock --target-dir=/tmp -- --test-threads=1 --nocapture
run: sudo -u nobody RUST_BACKTRACE=1 XDG_STATE_HOME=/tmp BUILDDIR=/tmp PKGDEST=/tmp SRCDEST=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features generate,mock --target-dir=/tmp -- --test-threads=1 --nocapture

test-git:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -64,9 +64,5 @@ jobs:
- name: Build
run: cargo build --locked --features git,generate

- name: chown
run: |
chown -R nobody: .
- name: Test
run: sudo -u nobody BUILDDIR=/tmp PKGDEST=/tmp SRCDEST=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features git,generate,mock --target-dir=/tmp -- --test-threads=1 --nocapture
run: sudo -u nobody XDG_STATE_HOME=/tmp BUILDDIR=/tmp PKGDEST=/tmp SRCDEST=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features git,generate,mock --target-dir=/tmp -- --nocapture
12 changes: 6 additions & 6 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> {
let tmp = TempDir::new().unwrap();
let dir = tmp.path();
let testdata = Path::new(&var("CARGO_MANIFEST_DIR").unwrap()).join("testdata");
println!("1");

let status = Command::new("cp")
.arg("-rp")
Expand Down Expand Up @@ -60,8 +59,7 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> {
}

std::fs::create_dir_all(dir.join("cache/pkg"))?;

std::fs::create_dir_all(testdata.join("pkg"))?;
let _ = std::fs::create_dir_all(testdata.join("pkg"));

let mut file = fs::OpenOptions::new()
.append(true)
Expand Down Expand Up @@ -139,7 +137,6 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> {
let mut path = std::env::var("PATH").unwrap();
path.push(':');
path.push_str(testdata.join("bin").to_str().unwrap());
println!("4");

std::env::set_var("PACMAN", "true");
std::env::set_var("PACMAN_CONF", dir.join("pacman.conf"));
Expand Down Expand Up @@ -178,12 +175,15 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> {
let ret = paru::run(&args).await;
assert_eq!(ret, 0);
}
println!("5");

args.extend(run_args);
let ret = paru::run(&args).await;

for pkg in std::fs::read_dir(dir.join("cache/pkg"))? {
for pkg in std::fs::read_dir(dir.join("cache/pkg"))
.ok()
.into_iter()
.flatten()
{
let path = pkg?.path();

let name = path.file_name().unwrap().to_str().unwrap();
Expand Down

0 comments on commit 8bd7c5d

Please sign in to comment.