on master help sign in
Include expected test failures in build-plan.txt

Pinging @manny-fp. This change was necessary since the list of expected failures will change over time, but old build plans should *not* depend on updates to the list. This breaks the file format of build-plan.txt slightly, though it is easy to fix old files. As an example: -- BEGIN expected-failures GLUT HTF HTTP Octree ... -- END expected-failures

commit8731ac1d24a148160e3bd8121f0f238b844dd1cc authorMichael Snoyman <michael@snoyman.com> dateTue 21 Oct 2014, 11:54 (12 years ago) parent6de04c4
6 files changed+15−13
Stackage/Build.hs−5 Stackage/BuildPlan.hs+4−1 Stackage/InstallInfo.hs+1−1 Stackage/Select.hs+2−1 Stackage/Test.hs+4−3 Stackage/Types.hs+4−2
Stackage/Build.hs−5
@@ -26,11 +26,6 @@ defaultBuildSettings :: Maybe Int -- ^ argument to -j
2626 -> BuildSettings
2727defaultBuildSettings cores version = BuildSettings
2828 { 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
3429 , extraArgs = \bs -> "-fnetwork23" : "-fhttps" :
3530 case bs of
3631 BSTest -> []
Stackage/BuildPlan.hs+4−1
@@ -36,6 +36,7 @@ instance AsString BuildPlan where
3636 , makeSection "core" $ Map.toList bpCore
3737 , makeSection "optional-core" $ Map.toList bpOptionalCore
3838 , makeSection "skipped-tests" $ Set.toList bpSkippedTests
39+ , makeSection "expected-failures" $ Set.toList bpExpectedFailures
3940 ]
4041 fromString s1 = do
4142 (tools, s2) <- getSection "tools" s1
@@ -43,14 +44,16 @@ instance AsString BuildPlan where
4344 (core, s4) <- getSection "core" s3
4445 (optionalCore, s5) <- getSection "optional-core" s4
4546 (skipped, s6) <- getSection "skipped-tests" s5
47+ (failures, s7) <- getSection "expected-failures" s6
4648 let bp = BuildPlan
4749 { bpTools = tools
4850 , bpPackages = Map.fromList packages
4951 , bpCore = Map.fromList core
5052 , bpOptionalCore = Map.fromList optionalCore
5153 , bpSkippedTests = Set.fromList skipped
54+ , bpExpectedFailures = Set.fromList failures
5255 }
53− return (bp, s6)
56+ return (bp, s7)
5457
5558makeSection :: AsString a => String -> [a] -> String
5659makeSection title contents = unlines
Stackage/InstallInfo.hs+1−1
@@ -170,7 +170,7 @@ checkBadVersions :: SelectSettings
170170checkBadVersions settings core (PackageDB pdb) buildPlan =
171171 Map.unions $ map getBadVersions $ Map.toList $ Map.filterWithKey unexpectedFailure buildPlan
172172 where
173− unexpectedFailure name _ = name `Set.notMember` expectedFailuresSelect settings
173+ unexpectedFailure name _ = name `Set.notMember` expectedFailures settings
174174
175175 getBadVersions :: (PackageName, BuildInfo) -> Map String (Map PackageName (Version, VersionRange))
176176 getBadVersions (name, bi)
Stackage/Select.hs+2−1
@@ -23,7 +23,7 @@ defaultSelectSettings :: GhcMajorVersion
2323 -> SelectSettings
2424defaultSelectSettings version requireHP = SelectSettings
2525 { extraCore = defaultExtraCore version
26− , expectedFailuresSelect = defaultExpectedFailures version requireHP
26+ , expectedFailures = defaultExpectedFailures version requireHP
2727 , stablePackages = defaultStablePackages version
2828 , haskellPlatformDir = "hp"
2929 , requireHaskellPlatform = True
@@ -82,6 +82,7 @@ select settings' = do
8282 , bpOptionalCore = iiOptionalCore ii
8383 , bpCore = iiCore ii
8484 , bpSkippedTests = skippedTests settings'
85+ , bpExpectedFailures = expectedFailures settings'
8586 }
8687
8788-- | Get all of the build tools required.
Stackage/Test.hs+4−3
@@ -40,7 +40,7 @@ runTestSuites settings' bp = do
4040 copyBuiltInHaddocks docdir
4141
4242 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
4444 unless allPass $ error $ "There were failures, please see the logs in " ++ testdir
4545 where
4646 notSkipped p _ = p `Set.notMember` bpSkippedTests bp
@@ -107,9 +107,10 @@ runTestSuite :: CabalVersion
107107 -> BuildSettings
108108 -> FilePath -- ^ testdir
109109 -> FilePath -- ^ docdir
110+ -> BuildPlan
110111 -> (PackageName, SelectedPackageInfo)
111112 -> IO Bool
112−runTestSuite cabalVersion settings testdir docdir (packageName, SelectedPackageInfo {..}) = do
113+runTestSuite cabalVersion settings testdir docdir bp (packageName, SelectedPackageInfo {..}) = do
113114 -- Set up a new environment that includes the sandboxed bin folder in PATH.
114115 env' <- getModifiedEnv settings
115116 let menv = Just $ addSandbox env'
@@ -154,7 +155,7 @@ runTestSuite cabalVersion settings testdir docdir (packageName, SelectedPackageI
154155 (dir </> "dist" </> "doc" </> "html" </> packageName')
155156 (docdir </> package)
156157 return True
157− let expectedFailure = packageName `Set.member` expectedFailuresBuild settings
158+ let expectedFailure = packageName `Set.member` bpExpectedFailures bp
158159 if passed
159160 then do
160161 removeFile logfile
Stackage/Types.hs+4−2
@@ -85,6 +85,9 @@ data BuildPlan = BuildPlan
8585 , bpOptionalCore :: Map PackageName Version
8686 -- ^ See 'iiOptionalCore'
8787 , bpSkippedTests :: Set PackageName
88+ , bpExpectedFailures :: Set PackageName
89+ -- ^ Expected test failures. Unlike SkippedTests, we should still try to
90+ -- build them.
8891 }
8992
9093-- | Email address of a Stackage maintainer.
@@ -109,7 +112,7 @@ data SelectSettings = SelectSettings
109112 --
110113 -- Returns a reason for stripping in Left, or Right if the package is
111114 -- allowed.
112− , expectedFailuresSelect :: Set PackageName
115+ , expectedFailures :: Set PackageName
113116 , excludedPackages :: Set PackageName
114117 -- ^ Packages which should be dropped from the list of stable packages,
115118 -- even if present via the Haskell Platform or @stablePackages@. If these
@@ -135,7 +138,6 @@ data BuildStage = BSTools | BSBuild | BSTest
135138data BuildSettings = BuildSettings
136139 { sandboxRoot :: FilePath
137140 , extraArgs :: BuildStage -> [String]
138− , expectedFailuresBuild :: Set PackageName
139141 , testWorkerThreads :: Int
140142 -- ^ How many threads to spawn for running test suites.
141143 , buildDocs :: Bool