Commit Graph

103 Commits

Author SHA1 Message Date
7dcf6a01c6 JSON -> JSON::MaybeXS 2021-12-13 15:37:56 -05:00
26b197ea62 RunCommand: calculate all the commands to run against before starting 2021-12-08 20:29:32 -05:00
b7962c3882 RunCommand: Move the json validation testing to its own test 2021-12-08 20:29:27 -05:00
bb91f96381 RunCommand: test isEnabled, configSectionMatches, and eventMatches 2021-12-08 20:03:43 -05:00
9dfa34682d RunCommand tests: move in to a subdirectory 2021-12-08 20:03:43 -05:00
7227395a72 Merge pull request #1068 from DeterminateSystems/fix-some-warnings
Fix some warnings
2021-12-03 15:38:46 -05:00
ecb1454cf1 t/Controller/Root: test narinfo path 2021-12-03 12:12:53 -08:00
085b02e092 t/Helper/CatalystUtils.t: test trim functionality 2021-12-03 11:58:19 -08:00
4d5dfec8c7 TT.t: fixup $_, since _ is a special variable, not a throwaway 2021-12-01 13:46:58 -05:00
ce6805f02b fixup: TT.t: move the :'s to the next line 2021-11-22 20:20:06 -05:00
03323f6ef1 TT: add helpers for linking to jobs, jobsets, and projects, and for generating colon separated names. 2021-11-22 13:38:53 -05:00
5917de4948 t/plugins/runcommand.t: output the filename if it fails to open 2021-11-17 15:05:28 -05:00
e5a4147f0a runcommand.t: stop dumping the json 2021-11-17 15:05:28 -05:00
9ae676072c Merge pull request #1051 from DeterminateSystems/restart-cancel-resultset-p2
Validate and fix canceling builds
2021-10-27 18:22:20 +02:00
c1630e6d80 Admin/clear-queue-non-current: test behavior 2021-10-27 11:43:58 -04:00
d19890a4e1 JobsetEval/cancel: test & fix 2021-10-27 11:43:36 -04:00
ef9a9fa481 Merge pull request #1025 from lukegb/hydra-better-errors
Produce better errors for failing jobsets
2021-10-26 12:35:45 -04:00
a62c2a4d71 JobsetEval/restart-*: Write tests for the behavior 2021-10-26 10:45:33 -04:00
383b395b00 Test canceling builds. 2021-10-26 09:44:58 -04:00
67ebce8493 Output evaluation errors without crashing if aggregate job is broken.
At the moment, aggregate jobs can easily break and cause the entire
evaluation to fail, which is not ideal. For Nixpkgs, we do have some
important aggregate jobs (like `tested`), but for debugging and building
purposes it's still useful to get a partial result even if the channel
won't actually advance.

This commit changes the behaviour of hydra-eval-jobs such that it
aggregates any errors found during the construction of an aggregate, and
will instead annotate the job with the evaluation failure such that it
shows up in a "cleaner" way.

There are really two types of failure that we care about: one is where
the attribute just ends up missing altogether in the final output, and
also where the attribute is in the output but fails to evaluate. Both
are handled here.

Note that this does mean that the same error message may be output
multiple times, but this aids debuggability because it'll be much
clearer what's blocking the job from being created.
2021-10-26 10:14:34 +01:00
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
d52e397503 Builds controller: add a test for restarting builds, fix restarting builds 2021-10-25 22:22:08 -04:00
5fbf1470bd (perl) machines file: support machine lines with multiple spaces between fields 2021-10-24 21:30:53 -04:00
b817124337 Hydra::Helper::Nix::getMachines: add a test
Fix parsing breakage from #1003: assigning the lines to $lines broke chomp and the filters.

This test validates the parsing works as expected, and also fixes
a minor bug where '-' in features isn't pruned, like in the C++
repo.
2021-10-23 22:53:55 -04:00
5285d0b6cb gittea test: prune trailing space 2021-10-20 13:09:39 -04:00
7095d00608 perlcritic: make all open() calls three-argument
Two-argument calls end up parsing the second argument to guess what
should happen, three-arg parses ... less?
2021-10-20 13:09:39 -04:00
43c056bb7b t/TaskDispatcher.t: array / arrayref consistency
Also fixes a test which was comparing the length of two lists
instead of the values inside the lists. Dang, Perl.
2021-10-20 11:38:27 -04:00
3990bd12e9 constituents test: add use warnings
This is causing CI to fail after #1026 merged. #1026 had a green
bill of health, but #1003 increased perlcritic to level 4. #1003
was not part of #1026 so it was not checked at perlcritic level 4.
2021-09-30 09:13:01 -04:00
4c8279044b Merge pull request #1026 from DeterminateSystems/constituents
add api endpoint: /build/<id>/constituents
2021-09-28 09:21:21 -04:00
2745226ada Merge pull request #1003 from DeterminateSystems/perlcritic-level-4
perlcritic: level 4
2021-09-27 20:23:55 +02:00
c60c8d10ea add api endpoint: /build/<id>/constituents
Returns a list of constituent builds
2021-09-24 16:30:44 -04:00
741590c923 perlcritic: explicitly assign the result of readdir/file reads 2021-09-07 21:55:55 -04:00
b1879132af ResultSet::TaskRetries: add missing method, get_retryable_task
Yet again, manual testing is proving to be insufficient. I'm pretty
sure I wrote this code but lost it in a rebase, or perhaps the switch
to result classes.

At any rate, this implements the actual "fetch a retry row and run it"
for the hydra-notify daemon.

Tested by hand.
2021-09-07 11:12:10 -04:00
21e1ff0da1 perlcritic: don't open files as bare words 2021-09-06 22:20:17 -04:00
55b7802b61 t/lib/Setup.pm: nix_config: default to empty string 2021-09-06 22:13:33 -04:00
4677a7c894 perlcritic: use strict, use warnings 2021-09-06 22:13:33 -04:00
b0055a23df TaskDispatcher: Support re-queueing tasks, and dropping tasks after 100 failures. 2021-09-02 10:06:26 -04:00
d0b0fc21b3 ResultSet::TaskRetries: teach about saving tasks 2021-09-02 10:06:26 -04:00
147fa4d029 Result::TaskRetries: Teach about requeue 2021-09-02 10:06:26 -04:00
42c2d2f387 Hydra::Math: add an exponential_backoff function 2021-09-02 10:06:26 -04:00
29738364fb ResultSet::TaskRetries: add get_seconds_to_next_retry
Get the number of seconds before the next retriable task is ready.

This number is specifically intended to be used as a timeout, where
`undef` means never time out.
2021-09-02 10:06:26 -04:00
1f2adf61aa hydra-notify: extract runPluginsForEvent to a TaskDispatcher 2021-09-02 10:06:26 -04:00
6d7ee27d25 hydra-notify: make the prometheus endpoint configurable, default-off 2021-08-24 10:56:13 -04:00
241985fb2d Start checking PRs with perlcritic 2021-08-20 11:06:43 -04:00
fa6d7abc13 hydra-notify: move BuildFinished processing to an Event 2021-08-13 16:51:29 -04:00
4a1389e36e hydra-notify: move StepFinished processing to an Event 2021-08-13 16:51:29 -04:00
4fdb20d3bd hydra-notify: move BuildStarted processing to an Event 2021-08-13 16:51:29 -04:00
4e86e55008 Event.pm: add a new_event helper to parse and construct an Event
An Event will be part of many Tasks
2021-08-13 16:51:29 -04:00
64a3e75c10 Event: init structure and parse existing messages 2021-08-13 16:51:29 -04:00
5027003285 Abstract over postgres' LISTEN/NOTIFY
This lets us test the event loop if we wanted, and lets us
test the listening behavior in isolation.
2021-08-12 13:54:05 -04:00