summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorAlp Mestanogullari <alpmestan@gmail.com>2019-11-01 12:06:05 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-07 21:24:59 -0500
commitd0ef83123e466365f5362b76d691bec489ffe94c (patch)
treeed98f62033f33bf144e49081893f7d4a94cfc711 /hadrian
parenta956663291435cbcb3ad7bc5db01597e8604063a (diff)
downloadhaskell-d0ef83123e466365f5362b76d691bec489ffe94c.tar.gz
hadrian: fix support for the recording of perf test results
Before this patch, Hadrian didn't care about the TEST_ENV and METRICS_FILE environment variables, that the performance testing infrastructure uses to record perf tests results from CI jobs. It now looks them up right before running the testsuite driver, and passes suitable --test-env/--metrics-file arguments when these environment variables are set.
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Settings/Builders/RunTest.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs
index 6e07d1407a..96df86606e 100644
--- a/hadrian/src/Settings/Builders/RunTest.hs
+++ b/hadrian/src/Settings/Builders/RunTest.hs
@@ -75,6 +75,8 @@ runTestBuilderArgs = builder RunTest ? do
(acceptPlatform, acceptOS) <- expr . liftIO $
(,) <$> (maybe False (=="YES") <$> lookupEnv "PLATFORM")
<*> (maybe False (=="YES") <$> lookupEnv "OS")
+ (testEnv, testMetricsFile) <- expr . liftIO $
+ (,) <$> lookupEnv "TEST_ENV" <*> lookupEnv "METRICS_FILE"
threads <- shakeThreads <$> expr getShakeOptions
os <- getTestSetting TestHostOS
@@ -138,9 +140,15 @@ runTestBuilderArgs = builder RunTest ? do
, arg "--config", arg $ "timeout_prog=" ++ show (top -/- timeoutProg)
, arg "--config", arg $ "stats_files_dir=" ++ statsFilesDir
, arg $ "--threads=" ++ show threads
+ , emitWhenSet testEnv $ \env -> arg ("--test-env=" ++ show env)
+ , emitWhenSet testMetricsFile $ \file -> mconcat
+ [ arg "--metrics-file", arg (show file) ]
, getTestArgs -- User-provided arguments from command line.
]
+ where emitWhenSet Nothing _ = mempty
+ emitWhenSet (Just v) f = f v
+
-- | Command line arguments for running GHC's test script.
getTestArgs :: Args
getTestArgs = do