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
This commit is contained in:
Michael Snoyman 2014-10-21 11:54:00 +03:00
parent 6de04c4feb
commit 8731ac1d24
6 changed files with 15 additions and 13 deletions

View File

@ -26,11 +26,6 @@ defaultBuildSettings :: Maybe Int -- ^ argument to -j
-> BuildSettings
defaultBuildSettings cores version = BuildSettings
{ sandboxRoot = "sandbox"
, expectedFailuresBuild = defaultExpectedFailures version
-- FIXME This is a hack. In fact, this whole thing is a hack. The
-- expected failures should be written to the build-plan.txt file and
-- read from there.
False
, extraArgs = \bs -> "-fnetwork23" : "-fhttps" :
case bs of
BSTest -> []

View File

@ -36,6 +36,7 @@ instance AsString BuildPlan where
, makeSection "core" $ Map.toList bpCore
, makeSection "optional-core" $ Map.toList bpOptionalCore
, makeSection "skipped-tests" $ Set.toList bpSkippedTests
, makeSection "expected-failures" $ Set.toList bpExpectedFailures
]
fromString s1 = do
(tools, s2) <- getSection "tools" s1
@ -43,14 +44,16 @@ instance AsString BuildPlan where
(core, s4) <- getSection "core" s3
(optionalCore, s5) <- getSection "optional-core" s4
(skipped, s6) <- getSection "skipped-tests" s5
(failures, s7) <- getSection "expected-failures" s6
let bp = BuildPlan
{ bpTools = tools
, bpPackages = Map.fromList packages
, bpCore = Map.fromList core
, bpOptionalCore = Map.fromList optionalCore
, bpSkippedTests = Set.fromList skipped
, bpExpectedFailures = Set.fromList failures
}
return (bp, s6)
return (bp, s7)
makeSection :: AsString a => String -> [a] -> String
makeSection title contents = unlines

View File

@ -170,7 +170,7 @@ checkBadVersions :: SelectSettings
checkBadVersions settings core (PackageDB pdb) buildPlan =
Map.unions $ map getBadVersions $ Map.toList $ Map.filterWithKey unexpectedFailure buildPlan
where
unexpectedFailure name _ = name `Set.notMember` expectedFailuresSelect settings
unexpectedFailure name _ = name `Set.notMember` expectedFailures settings
getBadVersions :: (PackageName, BuildInfo) -> Map String (Map PackageName (Version, VersionRange))
getBadVersions (name, bi)

View File

@ -23,7 +23,7 @@ defaultSelectSettings :: GhcMajorVersion
-> SelectSettings
defaultSelectSettings version requireHP = SelectSettings
{ extraCore = defaultExtraCore version
, expectedFailuresSelect = defaultExpectedFailures version requireHP
, expectedFailures = defaultExpectedFailures version requireHP
, stablePackages = defaultStablePackages version
, haskellPlatformDir = "hp"
, requireHaskellPlatform = True
@ -82,6 +82,7 @@ select settings' = do
, bpOptionalCore = iiOptionalCore ii
, bpCore = iiCore ii
, bpSkippedTests = skippedTests settings'
, bpExpectedFailures = expectedFailures settings'
}
-- | Get all of the build tools required.

View File

@ -40,7 +40,7 @@ runTestSuites settings' bp = do
copyBuiltInHaddocks docdir
cabalVersion <- getCabalVersion
allPass <- parFoldM (testWorkerThreads settings) (runTestSuite cabalVersion settings testdir docdir) (&&) True $ Map.toList selected
allPass <- parFoldM (testWorkerThreads settings) (runTestSuite cabalVersion settings testdir docdir bp) (&&) True $ Map.toList selected
unless allPass $ error $ "There were failures, please see the logs in " ++ testdir
where
notSkipped p _ = p `Set.notMember` bpSkippedTests bp
@ -107,9 +107,10 @@ runTestSuite :: CabalVersion
-> BuildSettings
-> FilePath -- ^ testdir
-> FilePath -- ^ docdir
-> BuildPlan
-> (PackageName, SelectedPackageInfo)
-> IO Bool
runTestSuite cabalVersion settings testdir docdir (packageName, SelectedPackageInfo {..}) = do
runTestSuite cabalVersion settings testdir docdir bp (packageName, SelectedPackageInfo {..}) = do
-- Set up a new environment that includes the sandboxed bin folder in PATH.
env' <- getModifiedEnv settings
let menv = Just $ addSandbox env'
@ -154,7 +155,7 @@ runTestSuite cabalVersion settings testdir docdir (packageName, SelectedPackageI
(dir </> "dist" </> "doc" </> "html" </> packageName')
(docdir </> package)
return True
let expectedFailure = packageName `Set.member` expectedFailuresBuild settings
let expectedFailure = packageName `Set.member` bpExpectedFailures bp
if passed
then do
removeFile logfile

View File

@ -85,6 +85,9 @@ data BuildPlan = BuildPlan
, bpOptionalCore :: Map PackageName Version
-- ^ See 'iiOptionalCore'
, bpSkippedTests :: Set PackageName
, bpExpectedFailures :: Set PackageName
-- ^ Expected test failures. Unlike SkippedTests, we should still try to
-- build them.
}
-- | Email address of a Stackage maintainer.
@ -109,7 +112,7 @@ data SelectSettings = SelectSettings
--
-- Returns a reason for stripping in Left, or Right if the package is
-- allowed.
, expectedFailuresSelect :: Set PackageName
, expectedFailures :: Set PackageName
, excludedPackages :: Set PackageName
-- ^ Packages which should be dropped from the list of stable packages,
-- even if present via the Haskell Platform or @stablePackages@. If these
@ -135,7 +138,6 @@ data BuildStage = BSTools | BSBuild | BSTest
data BuildSettings = BuildSettings
{ sandboxRoot :: FilePath
, extraArgs :: BuildStage -> [String]
, expectedFailuresBuild :: Set PackageName
, testWorkerThreads :: Int
-- ^ How many threads to spawn for running test suites.
, buildDocs :: Bool