Commit graph

24 commits

Author SHA1 Message Date
Graham Christensen 3a6c25489c Hydra::Helper::Nix: expose a captureStdoutStderrWithStdin, make it available in tests 2022-01-21 10:40:06 -05:00
Graham Christensen 2e195c524d evalSucceds/evalFails: log that the success or failure was not expected 2022-01-11 13:10:43 -05:00
Graham Christensen ae38cc5d04 test_context: support an override on jobsdir when creating a jobset 2022-01-11 10:17:14 -05:00
Graham Christensen 8d4c448e92 t: create a evalFails helper 2022-01-11 10:17:14 -05:00
Graham Christensen 40e556aee5 tests: evalSucceeds: don't print stdout/stderr unless it fails 2022-01-11 10:17:14 -05:00
Cole Helbling 35f55279c1 HydraTestContext: prefix names with t
This is necessary because jobset and project names are not allowed to
begin with a digit, and yet the generated jobset and project names would
do just that.

Not the most elegant solution, but it works.
2022-01-10 09:39:42 -05:00
Graham Christensen 5836bc9a11 HydraTestContext::makeAndEvaluateJobset: make a random user 2021-12-14 20:48:07 -05:00
Graham Christensen adfe74b76a HydraTestContext: give a helper for creating a project, jobset, evaluating jobs, and optionally building them.
In return, get a hash of all the build records.
2021-12-14 20:25:42 -05:00
Graham Christensen 3238496b3d t/Setup: move subs calling hydra-* programs to a CliPrograms module
Makes it so HydraTestContext can call them without an import loop
2021-12-14 20:25:02 -05:00
Graham Christensen 1fa141229f HydraTestContext: explicitly stop the db
This might, hopefully, I don't know, possibly force the
database to live a little while longer and *reduce* but not
eliminate errors around stopping the database before we lose all
our DB::PG handles to it.
2021-12-14 19:51:12 -05:00
Graham Christensen eca09bc980 Attempt to fix errors during test teardown 2021-12-14 16:31:41 -05:00
Luke Granger-Brown f2b51a017b Test Setup: fix evalSucceeds to actually output evaluation errors
At the moment, the jobset object is unlikely to actually retrieve the
evaluation error output, because it isn't refreshed after
hydra-eval-jobsets is run.

Explicitly calling DBIx::Class::Row->discard_changes causes any updated
data to be refreshed, at the cost of losing any not-yet committed
changes to the row.
2021-10-26 10:13:58 +01:00
Your Name 55b7802b61 t/lib/Setup.pm: nix_config: default to empty string 2021-09-06 22:13:33 -04:00
Your Name 4677a7c894 perlcritic: use strict, use warnings 2021-09-06 22:13:33 -04:00
Shay Bergmann ba557972c7
Add test to verify includes work 2021-07-26 17:16:40 +00:00
regnat 9c787e5e94 Document the use_external_destination_store test_init param 2021-04-29 07:24:20 +02:00
Théophane Hufschmitt 7af63658f1 tests: Make the external destination store optional
Co-authored-by: Graham Christensen <graham@grahamc.com>
2021-04-29 07:24:20 +02:00
regnat 0d3977866e Run the tests with a remote dest store
Set `dest_store` in the test hydra config, so that the testsuite ensures
that the distinction between the local store and the destination store
is properly taken into account.

Fix #938
2021-04-28 12:22:54 +02:00
Graham Christensen e45f852277 tests: allow specifying some nix config 2021-04-14 14:19:10 -04:00
Graham Christensen c7ac123dc5 Setup.pm: specify NIX_ env vars for running yath
Otherwise yath will try to use global configuration.
2021-04-14 14:19:10 -04:00
Graham Christensen 74d34c0f80 t/Setup.pm: sort NIX_ env vars 2021-04-14 14:19:09 -04:00
Graham Christensen 8aa59dcc1b Drop references to NIX_MANFIESTS_DIR and NIX_BUILD_HOOK
Neither of these have been supported in ~years.
2021-04-14 14:19:09 -04:00
Graham Christensen 6f662a606a
hydra-send-stats: add a failing test asserting it can run 2021-03-20 09:14:14 -04:00
Cole Helbling 025be052b7
tests: move to t, allow yath test from root
By moving the tests subdirectory to t, we gain the ability to run `yath
test` with no arguments from inside `nix develop` in the root of the
the repo.

(`nix develop` is necessary in order to set the proper env vars for
`yath` to find our test libraries.)
2021-03-05 09:49:06 -08:00