Commit d0ef8312 authored by Alp Mestanogullari's avatar Alp Mestanogullari Committed by Marge Bot

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.
parent a9566632
Pipeline #12396 failed with stages
in 203 minutes and 12 seconds
......@@ -202,7 +202,15 @@ lint-release-changelogs:
- mv _build/bindist/ghc*.tar.xz ghc.tar.xz
- export TOP=$(pwd)
- cd _build/bindist/ghc-*/ && ./configure --prefix=$TOP/_build/install && make install && cd ../../../
- hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --docs=no-sphinx test --summary-junit=./junit.xml --test-compiler=$TOP/_build/install/bin/ghc
- |
# Prepare to push git notes.
METRICS_FILE=$CI_PROJECT_DIR/performance-metrics.tsv
git config user.email "ben+ghc-ci@smart-cactus.org"
git config user.name "GHC GitLab CI"
- hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --docs=no-sphinx test --summary-junit=./junit.xml --test-compiler=$TOP/_build/install/bin/ghc || (METRICS_FILE=$METRICS_FILE .gitlab/push-test-metrics.sh && false)
- |
# Push git notes.
METRICS_FILE=$METRICS_FILE .gitlab/push-test-metrics.sh
cache:
key: hadrian
paths:
......@@ -239,7 +247,7 @@ validate-x86_64-linux-deb9-unreg-hadrian:
stage: full-build
variables:
CONFIGURE_ARGS: --enable-unregisterised
TEST_ENV: "x86_64-linux-deb9-unreg"
TEST_ENV: "x86_64-linux-deb9-unreg-hadrian"
hadrian-ghc-in-ghci:
<<: *only-default
......@@ -790,7 +798,7 @@ nightly-i386-windows-hadrian:
extends: .build-windows-hadrian
variables:
MSYSTEM: MINGW32
TEST_ENV: "x86_64-windows-hadrian"
TEST_ENV: "i386-windows-hadrian"
only:
variables:
- $NIGHTLY
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment