Make PathInput plugin cache validity configurable

PathInput plugin keeps a cache of path evaluations. This cache is simple, and
path is not checked more than once every N seconds, where N=30. The caching is
there to avoid expensive calls to `nix-store --add`.

This change makes the validity period configurable. The main use case is
`api-test.pl` which was implemented wrong for a while, as the invocation of
`hydra-eval-jobset` would return the previous evaluation, claiming there are no
changes. The test has been fixed to check better for a new evaluation.
This commit is contained in:
Nikola Knezevic
2020-06-04 12:15:56 +02:00
parent 0b300e80ad
commit fceaed2b24
3 changed files with 13 additions and 3 deletions

View File

@ -198,7 +198,14 @@
tests.api.x86_64-linux =
with import (nixpkgs + "/nixos/lib/testing-python.nix") { system = "x86_64-linux"; };
simpleTest {
machine = hydraServer;
machine = { pkgs, ... }: {
imports = [ hydraServer ];
# No caching for PathInput plugin, otherwise we get wrong values
# (as it has a 30s window where no changes to the file are considered).
services.hydra-dev.extraConfig = ''
path_input_cache_validity_seconds = 0
'';
};
testScript =
let dbi = "dbi:Pg:dbname=hydra;user=root;"; in
''