Commit Graph

21 Commits

Author SHA1 Message Date
Tuomas Tynkkynen
282277dbc8 treewide: Use more makeBinPath 2016-08-23 01:18:10 +03:00
Vladimír Čunát
61b8d27b4c make-wrapper: fixup #14753 changes to make tests work
The tests need to expand passed variable and very carefully.
I could see no other easy way than to change single-quoting in
makeWrapper to double-quoting.
The tests now fail with the same problem as on master...
2016-06-19 13:38:46 +02:00
Domen Kožar
c56c3b6596 nixos/lib/testing.nix: make 'config' a free variable
cc @edolstra
2016-03-29 14:16:54 +01:00
Eelco Dolstra
1e18b75170 Prefer local build for the test driver script 2015-08-26 15:04:47 +02:00
Eelco Dolstra
a5645c5896 Let's not have a package named "lib"
See fb24c7c95b.

The "_" suffix follows the convention of the "if" package.
2015-08-11 11:52:40 +02:00
aszlig
fb24c7c95b
nixos/testing: Don't shadow "lib" in makePerlPath.
Regression introduced by 032f0ffdd03fa4d836825bcbb7e89f1abcf7e57f.

The change doesn't look obvious at the first sight why it may cause
problems with lib.makePerlPath, but it introduces a Perl package called
"lib".

And using "with perlPackages;" uses the Perl library "lib" instead of
the lib attribute set from pkgs.

So let's use pkgs.lib.makePerlPath directly in hope that there won't be
a Perl package anytime soon which is called "pkgs".

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-08-11 03:14:09 +02:00
Joachim Schiele
0731489953 all tests: added meta.maintainers section 2015-07-12 12:29:51 +02:00
aszlig
f12208c5a4
nixos/testing: Use stripped down tesseract only.
Only include the English language for the VM tests, because we most
likely won't need other languages. At least for now.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-05-22 08:01:17 +02:00
aszlig
8be00dc71d
nixos/test-driver: Make tesseract OCR optional.
By default this is now enabled, and it has to be explicitely enabled
using "enableOCR = true". If it is set to false, any usage of
getScreenText or waitForText will fail with an error suggesting to pass
enableOCR.

This should get rid of the rather large dependency on tesseract which
we don't need for most tests.

Note, that I'm using system("type -P") here to check whether tesseract
is in PATH. I know it's a bashism but we already have other bashisms
within the test scripts and we also run it with bash, so IMHO it's not a
problem here.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-05-22 07:21:58 +02:00
aszlig
235c2228ca
nixos/test-driver: Add new getScreenText function.
Basically, this creates a screenshot and throws tesseract at it to
recognize the characters from the screenshot. In order to produce a
result that is well enough, we're using lanczos scaling and scale the
image up to 400% of its original size.

This provides the base functionality for a new Machine method which will
be called waitForText. I originally had that idea long ago when writing
the VM tests for VirtualBox and Chromium, but thought it would be
disproportionate to the case.

The downside however is that VM tests now depend on tesseract, but given
the average runtime of our tests it really shouldn't have a too big
impact and it's only a runtime dependency after all.

Another issue is that the OCR process takes quite some time to finish,
but IMHO it's better (as in more deterministic) than to rely on sleep().

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-05-21 19:55:21 +02:00
Eelco Dolstra
13dcb35233 VM tests: Don't produce output on failure
Producing output makes it hard to restart builds that failed for
intermittent reasons (like timeouts). So let's not do that.
2015-04-10 11:18:30 +02:00
Eelco Dolstra
51c349d0cc test-driver: Use netpbm instead of imagemagick
Imagemagick pulls in 100s of megabytes of dependencies.
2014-09-25 00:07:30 +02:00
Bjørn Forsman
8e8f95beda nixos/test-reports: use local copy of jquery
The current way test reports get jquery,

  src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"

only works when getting reports over http:// or https://, not file://.
Change it so that it works for all protocols by using a local copy of
jquery.

This fixes the issue where locally created and browsed test reports
cannot be navigated properly; clicking the '+' symbol to expand
sub-sections doesn't work.
2014-09-07 15:47:59 +02:00
Eelco Dolstra
b599deedb4 makeTest: Pass nodes attribute
This allows doing things like:

  nix-build nixos/tests/misc.nix -A nodes.machine.config.system.build.initialRamdisk
2014-07-30 14:30:25 +02:00
Florian Friesdorf
6a3e6164bd support for nixos test names 2014-06-28 16:05:03 +02:00
Eelco Dolstra
019e9d8a3d Fix simpleTest function 2014-04-24 15:46:10 +02:00
Eelco Dolstra
36c05d5e5b Simplify running tests even further
Now you can just say:

  $ nix-build '<nixos/tests/login.nix>'

You can still get the driver script for interactive testing:

  $ nix-build '<nixos/tests/login.nix>' -A driver
  $ ./result/bin/nixos-test-driver
2014-04-14 14:23:38 +02:00
Eelco Dolstra
abe218950c Make it easier to run the tests
You can now run a test in the nixos/tests directory directly using
nix-build, e.g.

  $ nix-build '<nixos/tests/login.nix>' -A test

This gets rid of having to add the test to nixos/tests/default.nix.
(Of course, you still need to add it to nixos/release.nix if you want
Hydra to run the test.)
2014-04-14 14:02:44 +02:00
Eelco Dolstra
497997cc38 Move generation of coverage reports from nixos/lib/testing to releaseTools
Also, turn some stdenv adapters into setup hooks.
2014-03-03 13:57:08 +01:00
Eelco Dolstra
6dafee8d67 Fix runInMachine
It requires a writable /nix/store to store the build result.  Also,
wait until we've reached multi-user.target before doing the build, and
do a sync at the end to ensure all data to $out is properly written.

http://hydra.nixos.org/build/6496716
2013-10-16 11:37:38 +02:00
Eelco Dolstra
5c1f8cbc70 Move all of NixOS to nixos/ in preparation of the repository merge 2013-10-10 13:28:20 +02:00