mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-02-20 18:25:48 +01:00
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:
parent
6de04c4feb
commit
8731ac1d24
@ -26,11 +26,6 @@ defaultBuildSettings :: Maybe Int -- ^ argument to -j
|
|||||||
-> BuildSettings
|
-> BuildSettings
|
||||||
defaultBuildSettings cores version = BuildSettings
|
defaultBuildSettings cores version = BuildSettings
|
||||||
{ sandboxRoot = "sandbox"
|
{ 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" :
|
, extraArgs = \bs -> "-fnetwork23" : "-fhttps" :
|
||||||
case bs of
|
case bs of
|
||||||
BSTest -> []
|
BSTest -> []
|
||||||
|
|||||||
@ -36,6 +36,7 @@ instance AsString BuildPlan where
|
|||||||
, makeSection "core" $ Map.toList bpCore
|
, makeSection "core" $ Map.toList bpCore
|
||||||
, makeSection "optional-core" $ Map.toList bpOptionalCore
|
, makeSection "optional-core" $ Map.toList bpOptionalCore
|
||||||
, makeSection "skipped-tests" $ Set.toList bpSkippedTests
|
, makeSection "skipped-tests" $ Set.toList bpSkippedTests
|
||||||
|
, makeSection "expected-failures" $ Set.toList bpExpectedFailures
|
||||||
]
|
]
|
||||||
fromString s1 = do
|
fromString s1 = do
|
||||||
(tools, s2) <- getSection "tools" s1
|
(tools, s2) <- getSection "tools" s1
|
||||||
@ -43,14 +44,16 @@ instance AsString BuildPlan where
|
|||||||
(core, s4) <- getSection "core" s3
|
(core, s4) <- getSection "core" s3
|
||||||
(optionalCore, s5) <- getSection "optional-core" s4
|
(optionalCore, s5) <- getSection "optional-core" s4
|
||||||
(skipped, s6) <- getSection "skipped-tests" s5
|
(skipped, s6) <- getSection "skipped-tests" s5
|
||||||
|
(failures, s7) <- getSection "expected-failures" s6
|
||||||
let bp = BuildPlan
|
let bp = BuildPlan
|
||||||
{ bpTools = tools
|
{ bpTools = tools
|
||||||
, bpPackages = Map.fromList packages
|
, bpPackages = Map.fromList packages
|
||||||
, bpCore = Map.fromList core
|
, bpCore = Map.fromList core
|
||||||
, bpOptionalCore = Map.fromList optionalCore
|
, bpOptionalCore = Map.fromList optionalCore
|
||||||
, bpSkippedTests = Set.fromList skipped
|
, bpSkippedTests = Set.fromList skipped
|
||||||
|
, bpExpectedFailures = Set.fromList failures
|
||||||
}
|
}
|
||||||
return (bp, s6)
|
return (bp, s7)
|
||||||
|
|
||||||
makeSection :: AsString a => String -> [a] -> String
|
makeSection :: AsString a => String -> [a] -> String
|
||||||
makeSection title contents = unlines
|
makeSection title contents = unlines
|
||||||
|
|||||||
@ -170,7 +170,7 @@ checkBadVersions :: SelectSettings
|
|||||||
checkBadVersions settings core (PackageDB pdb) buildPlan =
|
checkBadVersions settings core (PackageDB pdb) buildPlan =
|
||||||
Map.unions $ map getBadVersions $ Map.toList $ Map.filterWithKey unexpectedFailure buildPlan
|
Map.unions $ map getBadVersions $ Map.toList $ Map.filterWithKey unexpectedFailure buildPlan
|
||||||
where
|
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 :: (PackageName, BuildInfo) -> Map String (Map PackageName (Version, VersionRange))
|
||||||
getBadVersions (name, bi)
|
getBadVersions (name, bi)
|
||||||
|
|||||||
@ -23,7 +23,7 @@ defaultSelectSettings :: GhcMajorVersion
|
|||||||
-> SelectSettings
|
-> SelectSettings
|
||||||
defaultSelectSettings version requireHP = SelectSettings
|
defaultSelectSettings version requireHP = SelectSettings
|
||||||
{ extraCore = defaultExtraCore version
|
{ extraCore = defaultExtraCore version
|
||||||
, expectedFailuresSelect = defaultExpectedFailures version requireHP
|
, expectedFailures = defaultExpectedFailures version requireHP
|
||||||
, stablePackages = defaultStablePackages version
|
, stablePackages = defaultStablePackages version
|
||||||
, haskellPlatformDir = "hp"
|
, haskellPlatformDir = "hp"
|
||||||
, requireHaskellPlatform = True
|
, requireHaskellPlatform = True
|
||||||
@ -82,6 +82,7 @@ select settings' = do
|
|||||||
, bpOptionalCore = iiOptionalCore ii
|
, bpOptionalCore = iiOptionalCore ii
|
||||||
, bpCore = iiCore ii
|
, bpCore = iiCore ii
|
||||||
, bpSkippedTests = skippedTests settings'
|
, bpSkippedTests = skippedTests settings'
|
||||||
|
, bpExpectedFailures = expectedFailures settings'
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | Get all of the build tools required.
|
-- | Get all of the build tools required.
|
||||||
|
|||||||
@ -40,7 +40,7 @@ runTestSuites settings' bp = do
|
|||||||
copyBuiltInHaddocks docdir
|
copyBuiltInHaddocks docdir
|
||||||
|
|
||||||
cabalVersion <- getCabalVersion
|
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
|
unless allPass $ error $ "There were failures, please see the logs in " ++ testdir
|
||||||
where
|
where
|
||||||
notSkipped p _ = p `Set.notMember` bpSkippedTests bp
|
notSkipped p _ = p `Set.notMember` bpSkippedTests bp
|
||||||
@ -107,9 +107,10 @@ runTestSuite :: CabalVersion
|
|||||||
-> BuildSettings
|
-> BuildSettings
|
||||||
-> FilePath -- ^ testdir
|
-> FilePath -- ^ testdir
|
||||||
-> FilePath -- ^ docdir
|
-> FilePath -- ^ docdir
|
||||||
|
-> BuildPlan
|
||||||
-> (PackageName, SelectedPackageInfo)
|
-> (PackageName, SelectedPackageInfo)
|
||||||
-> IO Bool
|
-> 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.
|
-- Set up a new environment that includes the sandboxed bin folder in PATH.
|
||||||
env' <- getModifiedEnv settings
|
env' <- getModifiedEnv settings
|
||||||
let menv = Just $ addSandbox env'
|
let menv = Just $ addSandbox env'
|
||||||
@ -154,7 +155,7 @@ runTestSuite cabalVersion settings testdir docdir (packageName, SelectedPackageI
|
|||||||
(dir </> "dist" </> "doc" </> "html" </> packageName')
|
(dir </> "dist" </> "doc" </> "html" </> packageName')
|
||||||
(docdir </> package)
|
(docdir </> package)
|
||||||
return True
|
return True
|
||||||
let expectedFailure = packageName `Set.member` expectedFailuresBuild settings
|
let expectedFailure = packageName `Set.member` bpExpectedFailures bp
|
||||||
if passed
|
if passed
|
||||||
then do
|
then do
|
||||||
removeFile logfile
|
removeFile logfile
|
||||||
|
|||||||
@ -85,6 +85,9 @@ data BuildPlan = BuildPlan
|
|||||||
, bpOptionalCore :: Map PackageName Version
|
, bpOptionalCore :: Map PackageName Version
|
||||||
-- ^ See 'iiOptionalCore'
|
-- ^ See 'iiOptionalCore'
|
||||||
, bpSkippedTests :: Set PackageName
|
, bpSkippedTests :: Set PackageName
|
||||||
|
, bpExpectedFailures :: Set PackageName
|
||||||
|
-- ^ Expected test failures. Unlike SkippedTests, we should still try to
|
||||||
|
-- build them.
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | Email address of a Stackage maintainer.
|
-- | 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
|
-- Returns a reason for stripping in Left, or Right if the package is
|
||||||
-- allowed.
|
-- allowed.
|
||||||
, expectedFailuresSelect :: Set PackageName
|
, expectedFailures :: Set PackageName
|
||||||
, excludedPackages :: Set PackageName
|
, excludedPackages :: Set PackageName
|
||||||
-- ^ Packages which should be dropped from the list of stable packages,
|
-- ^ Packages which should be dropped from the list of stable packages,
|
||||||
-- even if present via the Haskell Platform or @stablePackages@. If these
|
-- even if present via the Haskell Platform or @stablePackages@. If these
|
||||||
@ -135,7 +138,6 @@ data BuildStage = BSTools | BSBuild | BSTest
|
|||||||
data BuildSettings = BuildSettings
|
data BuildSettings = BuildSettings
|
||||||
{ sandboxRoot :: FilePath
|
{ sandboxRoot :: FilePath
|
||||||
, extraArgs :: BuildStage -> [String]
|
, extraArgs :: BuildStage -> [String]
|
||||||
, expectedFailuresBuild :: Set PackageName
|
|
||||||
, testWorkerThreads :: Int
|
, testWorkerThreads :: Int
|
||||||
-- ^ How many threads to spawn for running test suites.
|
-- ^ How many threads to spawn for running test suites.
|
||||||
, buildDocs :: Bool
|
, buildDocs :: Bool
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user