Skip to content

Commit

Permalink
Wobble test script for release.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 committed Dec 10, 2022
1 parent 5a6e38e commit 78133d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions tests/Samples.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,25 @@ runTest f =
inBase = System.FilePath.takeBaseName inFile

System.Directory.copyFile inFile (dir </> inBase)
testScript <- System.Directory.makeAbsolute "tests/fakeRepo.sh"

System.Directory.copyFile "tests/fakeRepo.sh" (dir </> "fakeRepo.sh")

_ <- System.Process.readCreateProcess
((System.Process.shell (dir </> "fakeRepo.sh")) { System.Process.cwd = Just dir })
mempty
_ <- System.Process.waitForProcess =<< System.Process.runProcess
"bash"
[testScript] (Just dir)
Nothing
Nothing Nothing Nothing

replaceFile (dir </> inBase) "/tmp/nix-update-fetchgit-test" (Data.Text.pack dir)

System.Environment.setEnv "NIX_STATE_DIR" $ storeDir </> "state"
System.Environment.setEnv "NIX_STORE_DIR" $ storeDir
System.Environment.setEnv "NIX_STORE_DIR" storeDir

-- work around race condition https://github.com/NixOS/nix/issues/2706
System.Directory.createDirectoryIfMissing True $ storeDir </> "state/gcroots"

-- and another - error: SQLite database storeDir </> 'state/db/db.sqlite' is busy
_ <- System.Process.readCreateProcess
(System.Process.shell ("nix-store --init"))
(System.Process.shell "nix-store --init")
mempty

let env = Env (const (Data.Text.IO.hPutStrLn System.IO.stderr)) [] [] Wet False
Expand Down
2 changes: 1 addition & 1 deletion tests/fakeRepo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

# Prepares git repositories on the local machine that we will use for
# testing.
Expand Down

0 comments on commit 78133d1

Please sign in to comment.