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.
22 jobs for master in 203 minutes and 12 seconds (queued for 3 seconds)
Status Name Job ID Coverage
  Lint
passed lint-linters #195443
lint

00:00:13

passed lint-submods-branch #195446
lint

00:00:17

passed lint-testsuite #195444
lint

00:00:15

passed typecheck-testsuite #195445
lint

00:00:14

 
  Quick Build
passed hadrian-ghc-in-ghci #195447
x86_64-linux

00:07:43

 
  Build
passed release-x86_64-linux-deb9-dwarf #195450
x86_64-linux

01:50:01

passed validate-x86_64-linux-deb9-debug #195449
x86_64-linux

03:14:43

failed validate-x86_64-linux-deb9-hadrian #195448
x86_64-linux

02:54:01

 
  Full Build
skipped validate-aarch64-linux-deb9 #195453
aarch64-linux allowed to fail
skipped validate-armv7-linux-deb9 #195454
armv7-linux allowed to fail
skipped validate-i386-linux-deb9 #195455
x86_64-linux
skipped validate-x86_64-darwin #195452
x86_64-darwin
skipped validate-x86_64-linux-deb9-integer-simple #195456
x86_64-linux
skipped validate-x86_64-linux-deb9-unreg-hadrian #195451
x86_64-linux
skipped validate-x86_64-linux-fedora27 #195457
x86_64-linux
skipped validate-x86_64-windows #195459
x86_64-windows allowed to fail
skipped validate-x86_64-windows-hadrian #195458
x86_64-windows allowed to fail
 
  Cleanup
passed cleanup-darwin #195460
x86_64-darwin

00:00:09

 
  Packaging
skipped doc-tarball #195461
x86_64-linux allowed to fail
 
  Testing
skipped hackage #195462
x86_64-linux allowed to fail manual
skipped perf-nofib #195463
x86_64-linux
 
  Deploy
skipped pages #195464
x86_64-linux allowed to fail
 
Name Stage Failure
failed
validate-x86_64-linux-deb9-hadrian Build
Total                             1480.286s  100%                           
Build completed in 24m40s

$ # Push git notes. # collapsed multi-line command
ERROR: Metrics file not found: /builds/ghc/ghc/performance-metrics.tsv
Uploading artifacts...
junit.xml: found 1 matching files
Uploading artifacts to coordinator... ok
id=195448 responseStatus=201 Created token=1qHaMFAh
ERROR: Job failed: exit code 1