3s is too small a margin for a loaded slow system to start a bloated program. This leads to problems when tests are written on decent dev hardware but later run on build farms of potentially slower hardware, particularly in the case of non x86. The chance of needing the timeout is actually very small, so those rare 57s are a reasonable price to pay for fewer timeouts on build farms, each of which should be investigated and usually fixed by increasing the timeout.
21 lines
737 B
Nix
21 lines
737 B
Nix
{ runCommand, phoronix-test-suite }:
|
|
|
|
let
|
|
inherit (phoronix-test-suite) pname version;
|
|
in
|
|
|
|
runCommand "${pname}-tests" { meta.timeout = 60; }
|
|
''
|
|
# automatic initial setup to prevent interactive questions
|
|
${phoronix-test-suite}/bin/phoronix-test-suite enterprise-setup >/dev/null
|
|
# get version of installed program and compare with package version
|
|
if [[ `${phoronix-test-suite}/bin/phoronix-test-suite version` != *"${version}"* ]]; then
|
|
echo "Error: program version does not match package version"
|
|
exit 1
|
|
fi
|
|
# run dummy command
|
|
${phoronix-test-suite}/bin/phoronix-test-suite dummy_module.dummy-command >/dev/null
|
|
# needed for Nix to register the command as successful
|
|
touch $out
|
|
''
|