Skip to content

Commit

Permalink
Re #6531 Fix 4095-utf8-pure-nix test when in Docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Mar 27, 2024
1 parent 400dd12 commit fe9183c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/integration/tests/4095-utf8-pure-nix/Main.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import StackTest

import Control.Monad ( unless )
import Data.Maybe ( isJust )
import System.Environment ( lookupEnv )

-- This test requires that Nix is installed and that the NIX_PATH has been set
-- so as to allow the path <nixpkgs> to be used.
main :: IO ()
Expand All @@ -11,5 +15,11 @@ main
logInfo "Disabled on macOS as it takes too long to run, since it tries \
\to build GHC."
| otherwise = do
stack ["build", "--nix-pure"]
stack ["exec", "--nix-pure", "ShowUnicode"]
isInContainer <- getInContainer
unless isInContainer $ do
stack ["build", "--nix-pure"]
stack ["exec", "--nix-pure", "ShowUnicode"]

-- | 'True' if we are currently running inside a Docker container.
getInContainer :: IO Bool
getInContainer = isJust <$> lookupEnv "STACK_IN_CONTAINER"

0 comments on commit fe9183c

Please sign in to comment.