on master help sign in
Include expected test failures in build-plan.txt
8731ac1Michael Snoyman
Stackage/Build.hs−5
@@ -26,11 +26,6 @@ defaultBuildSettings :: Maybe Int -- ^ argument to -j
26 -> BuildSettings
26 -> BuildSettings
27defaultBuildSettings cores version = BuildSettings
27defaultBuildSettings cores version = BuildSettings
28 { sandboxRoot = "sandbox"
28 { sandboxRoot = "sandbox"
29− , expectedFailuresBuild = defaultExpectedFailures version
30− -- FIXME This is a hack. In fact, this whole thing is a hack. The
31− -- expected failures should be written to the build-plan.txt file and
32− -- read from there.
33− False
34 , extraArgs = \bs -> "-fnetwork23" : "-fhttps" :
29 , extraArgs = \bs -> "-fnetwork23" : "-fhttps" :
35 case bs of
30 case bs of
36 BSTest -> []
31 BSTest -> []
Stackage/BuildPlan.hs+4−1
@@ -36,6 +36,7 @@ instance AsString BuildPlan where
36 , makeSection "core" $ Map.toList bpCore
36 , makeSection "core" $ Map.toList bpCore
37 , makeSection "optional-core" $ Map.toList bpOptionalCore
37 , makeSection "optional-core" $ Map.toList bpOptionalCore
38 , makeSection "skipped-tests" $ Set.toList bpSkippedTests
38 , makeSection "skipped-tests" $ Set.toList bpSkippedTests
39+ , makeSection "expected-failures" $ Set.toList bpExpectedFailures
39 ]
40 ]
40 fromString s1 = do
41 fromString s1 = do
41 (tools, s2) <- getSection "tools" s1
42 (tools, s2) <- getSection "tools" s1
@@ -43,14 +44,16 @@ instance AsString BuildPlan where
43 (core, s4) <- getSection "core" s3
44 (core, s4) <- getSection "core" s3
44 (optionalCore, s5) <- getSection "optional-core" s4
45 (optionalCore, s5) <- getSection "optional-core" s4
45 (skipped, s6) <- getSection "skipped-tests" s5
46 (skipped, s6) <- getSection "skipped-tests" s5
47+ (failures, s7) <- getSection "expected-failures" s6
46 let bp = BuildPlan
48 let bp = BuildPlan
47 { bpTools = tools
49 { bpTools = tools
48 , bpPackages = Map.fromList packages
50 , bpPackages = Map.fromList packages
49 , bpCore = Map.fromList core
51 , bpCore = Map.fromList core
50 , bpOptionalCore = Map.fromList optionalCore
52 , bpOptionalCore = Map.fromList optionalCore
51 , bpSkippedTests = Set.fromList skipped
53 , bpSkippedTests = Set.fromList skipped
54+ , bpExpectedFailures = Set.fromList failures
52 }
55 }
53− return (bp, s6)
56+ return (bp, s7)
54
57
55makeSection :: AsString a => String -> [a] -> String
58makeSection :: AsString a => String -> [a] -> String
56makeSection title contents = unlines
59makeSection title contents = unlines
Stackage/InstallInfo.hs+1−1
@@ -170,7 +170,7 @@ checkBadVersions :: SelectSettings
170checkBadVersions settings core (PackageDB pdb) buildPlan =
170checkBadVersions settings core (PackageDB pdb) buildPlan =
171 Map.unions $ map getBadVersions $ Map.toList $ Map.filterWithKey unexpectedFailure buildPlan
171 Map.unions $ map getBadVersions $ Map.toList $ Map.filterWithKey unexpectedFailure buildPlan
172 where
172 where
173− unexpectedFailure name _ = name `Set.notMember` expectedFailuresSelect settings
173+ unexpectedFailure name _ = name `Set.notMember` expectedFailures settings
174
174
175 getBadVersions :: (PackageName, BuildInfo) -> Map String (Map PackageName (Version, VersionRange))
175 getBadVersions :: (PackageName, BuildInfo) -> Map String (Map PackageName (Version, VersionRange))
176 getBadVersions (name, bi)
176 getBadVersions (name, bi)
Stackage/Select.hs+2−1
@@ -23,7 +23,7 @@ defaultSelectSettings :: GhcMajorVersion
23 -> SelectSettings
23 -> SelectSettings
24defaultSelectSettings version requireHP = SelectSettings
24defaultSelectSettings version requireHP = SelectSettings
25 { extraCore = defaultExtraCore version
25 { extraCore = defaultExtraCore version
26− , expectedFailuresSelect = defaultExpectedFailures version requireHP
26+ , expectedFailures = defaultExpectedFailures version requireHP
27 , stablePackages = defaultStablePackages version
27 , stablePackages = defaultStablePackages version
28 , haskellPlatformDir = "hp"
28 , haskellPlatformDir = "hp"
29 , requireHaskellPlatform = True
29 , requireHaskellPlatform = True
@@ -82,6 +82,7 @@ select settings' = do
82 , bpOptionalCore = iiOptionalCore ii
82 , bpOptionalCore = iiOptionalCore ii
83 , bpCore = iiCore ii
83 , bpCore = iiCore ii
84 , bpSkippedTests = skippedTests settings'
84 , bpSkippedTests = skippedTests settings'
85+ , bpExpectedFailures = expectedFailures settings'
85 }
86 }
86
87
87-- | Get all of the build tools required.
88-- | Get all of the build tools required.
Stackage/Test.hs+4−3
@@ -40,7 +40,7 @@ runTestSuites settings' bp = do
40 copyBuiltInHaddocks docdir
40 copyBuiltInHaddocks docdir
41
41
42 cabalVersion <- getCabalVersion
42 cabalVersion <- getCabalVersion
43− allPass <- parFoldM (testWorkerThreads settings) (runTestSuite cabalVersion settings testdir docdir) (&&) True $ Map.toList selected
43+ allPass <- parFoldM (testWorkerThreads settings) (runTestSuite cabalVersion settings testdir docdir bp) (&&) True $ Map.toList selected
44 unless allPass $ error $ "There were failures, please see the logs in " ++ testdir
44 unless allPass $ error $ "There were failures, please see the logs in " ++ testdir
45 where
45 where
46 notSkipped p _ = p `Set.notMember` bpSkippedTests bp
46 notSkipped p _ = p `Set.notMember` bpSkippedTests bp
@@ -107,9 +107,10 @@ runTestSuite :: CabalVersion
107 -> BuildSettings
107 -> BuildSettings
108 -> FilePath -- ^ testdir
108 -> FilePath -- ^ testdir
109 -> FilePath -- ^ docdir
109 -> FilePath -- ^ docdir
110+ -> BuildPlan
110 -> (PackageName, SelectedPackageInfo)
111 -> (PackageName, SelectedPackageInfo)
111 -> IO Bool
112 -> IO Bool
112−runTestSuite cabalVersion settings testdir docdir (packageName, SelectedPackageInfo {..}) = do
113+runTestSuite cabalVersion settings testdir docdir bp (packageName, SelectedPackageInfo {..}) = do
113 -- Set up a new environment that includes the sandboxed bin folder in PATH.
114 -- Set up a new environment that includes the sandboxed bin folder in PATH.
114 env' <- getModifiedEnv settings
115 env' <- getModifiedEnv settings
115 let menv = Just $ addSandbox env'
116 let menv = Just $ addSandbox env'
@@ -154,7 +155,7 @@ runTestSuite cabalVersion settings testdir docdir (packageName, SelectedPackageI
154 (dir </> "dist" </> "doc" </> "html" </> packageName')
155 (dir </> "dist" </> "doc" </> "html" </> packageName')
155 (docdir </> package)
156 (docdir </> package)
156 return True
157 return True
157− let expectedFailure = packageName `Set.member` expectedFailuresBuild settings
158+ let expectedFailure = packageName `Set.member` bpExpectedFailures bp
158 if passed
159 if passed
159 then do
160 then do
160 removeFile logfile
161 removeFile logfile
Stackage/Types.hs+4−2
@@ -85,6 +85,9 @@ data BuildPlan = BuildPlan
85 , bpOptionalCore :: Map PackageName Version
85 , bpOptionalCore :: Map PackageName Version
86 -- ^ See 'iiOptionalCore'
86 -- ^ See 'iiOptionalCore'
87 , bpSkippedTests :: Set PackageName
87 , bpSkippedTests :: Set PackageName
88+ , bpExpectedFailures :: Set PackageName
89+ -- ^ Expected test failures. Unlike SkippedTests, we should still try to
90+ -- build them.
88 }
91 }
89
92
90-- | Email address of a Stackage maintainer.
93-- | Email address of a Stackage maintainer.
@@ -109,7 +112,7 @@ data SelectSettings = SelectSettings
109 --
112 --
110 -- Returns a reason for stripping in Left, or Right if the package is
113 -- Returns a reason for stripping in Left, or Right if the package is
111 -- allowed.
114 -- allowed.
112− , expectedFailuresSelect :: Set PackageName
115+ , expectedFailures :: Set PackageName
113 , excludedPackages :: Set PackageName
116 , excludedPackages :: Set PackageName
114 -- ^ Packages which should be dropped from the list of stable packages,
117 -- ^ Packages which should be dropped from the list of stable packages,
115 -- even if present via the Haskell Platform or @stablePackages@. If these
118 -- even if present via the Haskell Platform or @stablePackages@. If these
@@ -135,7 +138,6 @@ data BuildStage = BSTools | BSBuild | BSTest
135data BuildSettings = BuildSettings
138data BuildSettings = BuildSettings
136 { sandboxRoot :: FilePath
139 { sandboxRoot :: FilePath
137 , extraArgs :: BuildStage -> [String]
140 , extraArgs :: BuildStage -> [String]
138− , expectedFailuresBuild :: Set PackageName
139 , testWorkerThreads :: Int
141 , testWorkerThreads :: Int
140 -- ^ How many threads to spawn for running test suites.
142 -- ^ How many threads to spawn for running test suites.
141 , buildDocs :: Bool
143 , buildDocs :: Bool