Skip to content

Commit 01cf645

Browse files
authored
Skip the pypy3 sample environment test on Darwin, where it isn't built (#104)
1 parent a0d045e commit 01cf645

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tests/app/Spec/Tests/SampleEnvironments.hs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Data.Text as T
1414
import qualified Data.Yaml as Yaml
1515
import GHC.Stack
1616
import System.FilePath
17+
import System.Info (os)
1718
import Test.Sandwich as Sandwich
1819
import TestLib.JupyterRunnerContext
1920
import TestLib.NixTypes
@@ -26,7 +27,7 @@ import UnliftIO.Directory
2627
tests :: TopSpec
2728
tests = describe "Sample environments" $ introduceBootstrapNixpkgs $ introduceJustBubblewrap $ do
2829
parallelN 4 $
29-
forM_ (L.sort fileList) $ \file -> do
30+
forM_ (L.sort (L.filter (`notElem` unavailableHere) fileList)) $ \file -> do
3031
describe [i|#{file}|] $ do
3132
it "Builds" $ do
3233
let name = T.dropEnd 4 (T.pack file) -- Drop the .nix suffix
@@ -113,5 +114,12 @@ validatePackage envRoot attr (NixPackage {nixPackageMeta=(NixMeta {..}), ..}) =
113114
fileList :: [String]
114115
fileList = $(getFileListRelativeToRoot "sample_environments")
115116

117+
-- | Sample environments this platform doesn't provide, so we don't ask the flake for an
118+
-- attribute that isn't there. Keep in sync with the platform gating in sample_environments.nix.
119+
unavailableHere :: [String]
120+
unavailableHere
121+
| os == "darwin" = ["pypy3.nix"]
122+
| otherwise = []
123+
116124
main :: IO ()
117125
main = runSandwichWithCommandLineArgs Sandwich.defaultOptions tests

0 commit comments

Comments
 (0)