Skip to content
Snippets Groups Projects
Commit d0ef8312 authored by Alp Mestanogullari's avatar Alp Mestanogullari :squid: Committed by Marge Bot
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -202,7 +202,15 @@ lint-release-changelogs: ...@@ -202,7 +202,15 @@ lint-release-changelogs:
- mv _build/bindist/ghc*.tar.xz ghc.tar.xz - mv _build/bindist/ghc*.tar.xz ghc.tar.xz
- export TOP=$(pwd) - export TOP=$(pwd)
- cd _build/bindist/ghc-*/ && ./configure --prefix=$TOP/_build/install && make install && cd ../../../ - 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: cache:
key: hadrian key: hadrian
paths: paths:
...@@ -239,7 +247,7 @@ validate-x86_64-linux-deb9-unreg-hadrian: ...@@ -239,7 +247,7 @@ validate-x86_64-linux-deb9-unreg-hadrian:
stage: full-build stage: full-build
variables: variables:
CONFIGURE_ARGS: --enable-unregisterised CONFIGURE_ARGS: --enable-unregisterised
TEST_ENV: "x86_64-linux-deb9-unreg" TEST_ENV: "x86_64-linux-deb9-unreg-hadrian"
hadrian-ghc-in-ghci: hadrian-ghc-in-ghci:
<<: *only-default <<: *only-default
...@@ -790,7 +798,7 @@ nightly-i386-windows-hadrian: ...@@ -790,7 +798,7 @@ nightly-i386-windows-hadrian:
extends: .build-windows-hadrian extends: .build-windows-hadrian
variables: variables:
MSYSTEM: MINGW32 MSYSTEM: MINGW32
TEST_ENV: "x86_64-windows-hadrian" TEST_ENV: "i386-windows-hadrian"
only: only:
variables: variables:
- $NIGHTLY - $NIGHTLY
......
...@@ -75,6 +75,8 @@ runTestBuilderArgs = builder RunTest ? do ...@@ -75,6 +75,8 @@ runTestBuilderArgs = builder RunTest ? do
(acceptPlatform, acceptOS) <- expr . liftIO $ (acceptPlatform, acceptOS) <- expr . liftIO $
(,) <$> (maybe False (=="YES") <$> lookupEnv "PLATFORM") (,) <$> (maybe False (=="YES") <$> lookupEnv "PLATFORM")
<*> (maybe False (=="YES") <$> lookupEnv "OS") <*> (maybe False (=="YES") <$> lookupEnv "OS")
(testEnv, testMetricsFile) <- expr . liftIO $
(,) <$> lookupEnv "TEST_ENV" <*> lookupEnv "METRICS_FILE"
threads <- shakeThreads <$> expr getShakeOptions threads <- shakeThreads <$> expr getShakeOptions
os <- getTestSetting TestHostOS os <- getTestSetting TestHostOS
...@@ -138,9 +140,15 @@ runTestBuilderArgs = builder RunTest ? do ...@@ -138,9 +140,15 @@ runTestBuilderArgs = builder RunTest ? do
, arg "--config", arg $ "timeout_prog=" ++ show (top -/- timeoutProg) , arg "--config", arg $ "timeout_prog=" ++ show (top -/- timeoutProg)
, arg "--config", arg $ "stats_files_dir=" ++ statsFilesDir , arg "--config", arg $ "stats_files_dir=" ++ statsFilesDir
, arg $ "--threads=" ++ show threads , 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. , 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. -- | Command line arguments for running GHC's test script.
getTestArgs :: Args getTestArgs :: Args
getTestArgs = do getTestArgs = do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment