Skip to content

Commit 78133d1

Browse files
committed
Wobble test script for release.nix
1 parent 5a6e38e commit 78133d1

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

tests/Samples.hs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,25 @@ runTest f =
4242
inBase = System.FilePath.takeBaseName inFile
4343

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

46-
System.Directory.copyFile "tests/fakeRepo.sh" (dir </> "fakeRepo.sh")
47-
48-
_ <- System.Process.readCreateProcess
49-
((System.Process.shell (dir </> "fakeRepo.sh")) { System.Process.cwd = Just dir })
50-
mempty
47+
_ <- System.Process.waitForProcess =<< System.Process.runProcess
48+
"bash"
49+
[testScript] (Just dir)
50+
Nothing
51+
Nothing Nothing Nothing
5152

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

5455
System.Environment.setEnv "NIX_STATE_DIR" $ storeDir </> "state"
55-
System.Environment.setEnv "NIX_STORE_DIR" $ storeDir
56+
System.Environment.setEnv "NIX_STORE_DIR" storeDir
5657

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

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

6566
let env = Env (const (Data.Text.IO.hPutStrLn System.IO.stderr)) [] [] Wet False

tests/fakeRepo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
# Prepares git repositories on the local machine that we will use for
44
# testing.

0 commit comments

Comments
 (0)