Commit graph

221 commits

Author SHA1 Message Date
Graham Christensen f4c4b496d8 Projects: delete: delete all builds first
Deleting jobsets first would fail because buildmetrics has an FK
to the jobset. However, the jobset / project relationship is not
marked as CASCADE.

Deleting all the builds automatically cascades to delete
buildmetrics, so deleting the relevant builds first, then deleting
the jobset solves it.
2022-01-14 20:37:55 -05:00
Graham Christensen 0044622198 Projects: test deleting 2022-01-14 20:36:52 -05:00
Graham Christensen 8ae2daece7 root: test /steps and /evals 2022-01-14 16:49:58 -05:00
Graham Christensen e0e8840d8f Test /search 2022-01-14 16:38:25 -05:00
Graham Christensen 42a871e413
Merge pull request #1111 from DeterminateSystems/project-jobset/queue-summary-machines
Project jobset columns: fixup /queue-summary and /machines
2022-01-14 15:34:43 -05:00
Graham Christensen bdccad573c machines: test 2022-01-14 15:23:19 -05:00
Graham Christensen da516f70a4 queue summary: test 2022-01-14 15:23:19 -05:00
Graham Christensen a81e358016 API: test api/push-github 2022-01-14 14:57:32 -05:00
Graham Christensen 20db82b001 API test /api/push 2022-01-14 14:57:24 -05:00
Graham Christensen fe095a56c5 API: test /nrbuilds and fix jobset / project references 2022-01-14 14:57:15 -05:00
Graham Christensen e5c8a35423 API: test fetching the queue and latestbuilds 2022-01-14 14:57:03 -05:00
Graham Christensen 8383679bf6 test /queue and /status, both of which use buildListColumns 2022-01-14 12:48:51 -05:00
Graham Christensen 59d0259220 test /eval/ID/channel works
Uses buildListColumns
2022-01-14 12:48:51 -05:00
Graham Christensen 2de40f86ec test /job/PROJECT/JOBSET/JOB works
Uses buildListColumns
2022-01-14 12:48:51 -05:00
Graham Christensen 4a07622195 test /job/PROJECT/JOBSET/JOB/prometheus works
Uses buildListColumns
2022-01-14 12:48:51 -05:00
Graham Christensen b37ca88fd5 test /job/PROJECT/JOBSET/JOB/shield works
Uses buildListColumns
2022-01-14 12:48:51 -05:00
Graham Christensen 796cae0fd0 Test Job's builds and channel pages 2022-01-14 11:52:07 -05:00
Graham Christensen a2adb8cfb6 Test Jobset's builds and channel pages 2022-01-14 11:28:39 -05:00
Graham Christensen 23d7046522 t/Controller/Build/constituents.t: assert the response is valid JSON, dump if it isn't 2022-01-14 11:28:39 -05:00
Graham Christensen 9291cba89f Project: tests we can get the channel for the latest builds 2022-01-14 11:28:39 -05:00
Graham Christensen dcefb88373 test /project/NAME/all returns a 200 2022-01-14 11:28:39 -05:00
Graham Christensen 6d5b234ba2 hydra-eval-jobset/notification.t: comment which jobs produced which messages
I tried to write the test in such a way to assert the content matched
what we expected, but since the ordering of them is not known, it
is quite tricky to write.
2022-01-14 09:13:17 -05:00
Graham Christensen 42edd3a9d8 hydra-notify: respond to cached_build_queued 2022-01-14 09:13:17 -05:00
Graham Christensen 6b7f1da11e hydra-notify: operate on cached_build_finished events 2022-01-14 09:13:17 -05:00
Graham Christensen 4da80e736e hydra-eval-jobset: send notifications when cached queued / finished builds are submitted 2022-01-11 13:28:04 -05:00
Graham Christensen 769f56f793
Merge pull request #1101 from DeterminateSystems/hydra-eval-jobset-notifications
hydra-eval-jobset: test emitted notifications
2022-01-11 13:23:44 -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 2b163aa78b CatalystUtils::showJobName: write a basic test that shows it works 2022-01-11 11:48:02 -05:00
Graham Christensen 0ada412979 hydra-eval-jobset: write a test validating the events that comes out 2022-01-11 10:17:14 -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
Graham Christensen ca6ba409de Relocate new tests in to the Hydra subdir 2022-01-11 09:54:51 -05:00
Graham Christensen b41818e067
Merge pull request #1100 from DeterminateSystems/nest-tests
Tests: restructure to more closely mirror the sources
2022-01-11 09:53:16 -05:00
Graham Christensen a5d1d36fa6 Tests: restructure to more closely mirror the sources
t/ had lots of directories and files mirroring src/lib/Hydra. This moves
those files under t/Hydra
2022-01-10 15:34:52 -05:00
Cole Helbling 92bd0fae7d t/BuildDiff: test jobs without previous history 2022-01-10 12:11:06 -08:00
Cole Helbling 1ca786561f t/JobsetEval: test GETing the eval page 2022-01-10 12:11:05 -08:00
Cole Helbling 157a02bff7 t/BuildDiff: slightly refactor empty test to be more readable 2022-01-10 12:11:05 -08:00
Cole Helbling 220ccc68df t/BuildDiff: test diffing two jobs 2022-01-10 12:11:05 -08:00
Cole Helbling 0c51f3ca7d BuildDiff: make actual hash ref 2022-01-10 12:11:05 -08:00
Cole Helbling 0eb952d72d t/BuildDiff: init 2022-01-10 12:11:05 -08:00
Graham Christensen 98c88a4dbf
Merge pull request #1097 from DeterminateSystems/api-test-warnings
Api test warnings: clean up
2022-01-10 14:03:38 -05:00
Graham Christensen d8025fcf04 api-test.t: don't print request content
It adds noise to the logs
2022-01-10 11:02:01 -05:00
Graham Christensen 6b2f0a9fe1 api-test.t: set a default method 2022-01-10 11:02:01 -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 06360bfbb6 RunCommandLogs.t: use test_context to get a specific build
Fixes a build error: Can't use global @_ in 'my' at Schema/Result/RunCommandLogs.t line 20, near ', @_'
2022-01-07 15:05:33 -05:00
Graham Christensen a7aeb766aa RunCommandLogs: add a helper for if it failed with an exec error 2022-01-07 15:05:33 -05:00
Graham Christensen d849856dcd RunCommandLogs: add helpers for if it is running/failed/signaled 2022-01-07 15:05:33 -05:00
Graham Christensen c81acbf93e RunCommandLogs: test recording a signaled process without a core dump 2022-01-07 15:05:33 -05:00
Graham Christensen d003fec8a5 RunCommandLogs: add a did_succeed helper 2022-01-07 15:05:33 -05:00
Graham Christensen 5bb3e2be78 Record the errno if exec fails 2022-01-07 15:05:33 -05:00
Graham Christensen 4ce8239cea RunCommand: create run logs for each execution 2022-01-07 15:05:33 -05:00
Graham Christensen a14501c616 Tasks: only execute the event if the plugin is interested in it 2021-12-21 20:57:53 -05:00
Graham Christensen d195e545f5 hydra-notify: listen for build_queued events 2021-12-21 20:57:53 -05:00
Graham Christensen f2f8d571f3 queue-runner-status: fixup from perlcritic-level-2
>
> from_json was legacy / deprecated. This was the only use.
2021-12-15 17:24:23 -05:00
Graham Christensen fbce3b6ed1 default-machine-file: use makeAndEvaluateJobset 2021-12-14 20:52:40 -05:00
Graham Christensen 06f824ca48 notifications.t: use system() with lists 2021-12-14 20:48:19 -05:00
Graham Christensen 5836bc9a11 HydraTestContext::makeAndEvaluateJobset: make a random user 2021-12-14 20:48:07 -05:00
Graham Christensen c2384a04d8 notifications.t: move to makeAndEvaluateJobset 2021-12-14 20:41:21 -05:00
Graham Christensen 008321d972 build-products: switch to makeAndEvaluateJobset 2021-12-14 20:32:13 -05:00
Graham Christensen 7333d444c6 evaluate-basic.t: move to makeAndEvaluateJobset 2021-12-14 20:25:54 -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
Graham Christensen fc49a7129d JSON -> JSON::MaybeXS 2021-12-14 10:16:25 -05:00
Graham Christensen 30a7f068b7 AttributeSet helper: skip wantarray 2021-12-14 10:16:25 -05:00
Graham Christensen 327d79bc1d pin 2021-12-14 10:16:25 -05:00
Graham Christensen 7dcf6a01c6 JSON -> JSON::MaybeXS 2021-12-13 15:37:56 -05:00
Graham Christensen 26b197ea62 RunCommand: calculate all the commands to run against before starting 2021-12-08 20:29:32 -05:00
Graham Christensen b7962c3882 RunCommand: Move the json validation testing to its own test 2021-12-08 20:29:27 -05:00
Graham Christensen bb91f96381 RunCommand: test isEnabled, configSectionMatches, and eventMatches 2021-12-08 20:03:43 -05:00
Graham Christensen 9dfa34682d RunCommand tests: move in to a subdirectory 2021-12-08 20:03:43 -05:00
Graham Christensen 7227395a72
Merge pull request #1068 from DeterminateSystems/fix-some-warnings
Fix some warnings
2021-12-03 15:38:46 -05:00
Cole Helbling ecb1454cf1 t/Controller/Root: test narinfo path 2021-12-03 12:12:53 -08:00
Graham Christensen 085b02e092 t/Helper/CatalystUtils.t: test trim functionality 2021-12-03 11:58:19 -08:00
Graham Christensen 4d5dfec8c7 TT.t: fixup $_, since _ is a special variable, not a throwaway 2021-12-01 13:46:58 -05:00
Graham Christensen ce6805f02b fixup: TT.t: move the :'s to the next line 2021-11-22 20:20:06 -05:00
Graham Christensen 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
Graham Christensen 5917de4948 t/plugins/runcommand.t: output the filename if it fails to open 2021-11-17 15:05:28 -05:00
Graham Christensen e5a4147f0a runcommand.t: stop dumping the json 2021-11-17 15:05:28 -05:00
Eelco Dolstra 9ae676072c
Merge pull request #1051 from DeterminateSystems/restart-cancel-resultset-p2
Validate and fix canceling builds
2021-10-27 18:22:20 +02:00
Graham Christensen c1630e6d80 Admin/clear-queue-non-current: test behavior 2021-10-27 11:43:58 -04:00
Graham Christensen d19890a4e1 JobsetEval/cancel: test & fix 2021-10-27 11:43:36 -04:00
Graham Christensen ef9a9fa481
Merge pull request #1025 from lukegb/hydra-better-errors
Produce better errors for failing jobsets
2021-10-26 12:35:45 -04:00
Graham Christensen a62c2a4d71 JobsetEval/restart-*: Write tests for the behavior 2021-10-26 10:45:33 -04:00
Graham Christensen 383b395b00 Test canceling builds. 2021-10-26 09:44:58 -04:00
Luke Granger-Brown 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
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
Graham Christensen d52e397503 Builds controller: add a test for restarting builds, fix restarting builds 2021-10-25 22:22:08 -04:00
Graham Christensen 5fbf1470bd (perl) machines file: support machine lines with multiple spaces between fields 2021-10-24 21:30:53 -04:00
Graham Christensen 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
Graham Christensen 5285d0b6cb gittea test: prune trailing space 2021-10-20 13:09:39 -04:00
Graham Christensen 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
Graham Christensen 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
Graham Christensen 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
Graham Christensen 4c8279044b
Merge pull request #1026 from DeterminateSystems/constituents
add api endpoint: /build/<id>/constituents
2021-09-28 09:21:21 -04:00
Eelco Dolstra 2745226ada
Merge pull request #1003 from DeterminateSystems/perlcritic-level-4
perlcritic: level 4
2021-09-27 20:23:55 +02:00
Graham Christensen c60c8d10ea add api endpoint: /build/<id>/constituents
Returns a list of constituent builds
2021-09-24 16:30:44 -04:00
Graham Christensen 741590c923 perlcritic: explicitly assign the result of readdir/file reads 2021-09-07 21:55:55 -04:00