Commit graph

83 commits

Author SHA1 Message Date
Graham Christensen 383b395b00 Test canceling builds. 2021-10-26 09:44:58 -04: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
Graham Christensen 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
Graham Christensen 21e1ff0da1 perlcritic: don't open files as bare words 2021-09-06 22:20:17 -04: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
Graham Christensen b0055a23df TaskDispatcher: Support re-queueing tasks, and dropping tasks after 100 failures. 2021-09-02 10:06:26 -04:00
Graham Christensen d0b0fc21b3 ResultSet::TaskRetries: teach about saving tasks 2021-09-02 10:06:26 -04:00
Graham Christensen 147fa4d029 Result::TaskRetries: Teach about requeue 2021-09-02 10:06:26 -04:00
Graham Christensen 42c2d2f387 Hydra::Math: add an exponential_backoff function 2021-09-02 10:06:26 -04:00
Graham Christensen 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
Graham Christensen 1f2adf61aa hydra-notify: extract runPluginsForEvent to a TaskDispatcher 2021-09-02 10:06:26 -04:00
Your Name 6d7ee27d25 hydra-notify: make the prometheus endpoint configurable, default-off 2021-08-24 10:56:13 -04:00
Your Name 241985fb2d Start checking PRs with perlcritic 2021-08-20 11:06:43 -04:00
Graham Christensen fa6d7abc13 hydra-notify: move BuildFinished processing to an Event 2021-08-13 16:51:29 -04:00
Graham Christensen 4a1389e36e hydra-notify: move StepFinished processing to an Event 2021-08-13 16:51:29 -04:00
Graham Christensen 4fdb20d3bd hydra-notify: move BuildStarted processing to an Event 2021-08-13 16:51:29 -04:00
Graham Christensen 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
Graham Christensen 64a3e75c10 Event: init structure and parse existing messages 2021-08-13 16:51:29 -04:00
Graham Christensen 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
Shay Bergmann ba557972c7
Add test to verify includes work 2021-07-26 17:16:40 +00:00
Cole Helbling e6a8412a12 Jobset: test type-related constraints
Prior to https://github.com/NixOS/hydra/pull/856, the `type`-related constraints
were a bit too loose, allowing some variations that should have been seen as
invalid. This commit adds a test (inspired by
https://github.com/NixOS/hydra/pull/856#issuecomment-772820929) to ensure these
constraints stay unviolated.
2021-07-20 10:38:22 -07:00
Graham Christensen cb8929b7ed Tighten up 'should exit with return code' 2021-06-16 11:48:49 -04:00
Graham Christensen 2ac47e8013 Test that each page listing evals works
PR #860 caused a regression that broke some loads.
2021-06-16 11:22:40 -04:00
Graham Christensen 71453dd341 Expose Prometheus metrics at /metrics
Exposes metrics:

* http_request_duration_seconds_bucket
* http_request_size_bytes_bucket
* http_response_size_bytes_bucket
* http_requests_total

with labels of action and controller to help identify popular
endpoints and their performance characteristics.
2021-06-10 20:02:42 -04:00
Cole Helbling 45ced33ab6
Projects: don't respond with unnecessary declarative field
If the project isn't declarative, who cares about it in the response? After
setting the `declfile` to an empty string, everything related to declarative-
ness is wiped out, anyways.
2021-05-24 15:26:34 -07:00
Cole Helbling 588a3a774f
Project: add test for declarative->normal project transition
Also split into subtests.
2021-05-06 08:47:29 -07:00
Cole Helbling ad13d13436
Project: add declfile, decltype, declvalue to API
This makes it possible to create declarative projects via a PUT request, and
also exposes the currently-configured values to GET requests.
2021-05-02 17:45:14 -07:00
Cole Helbling d0682c804d
api-test: test deleting a project
As of this commit, this test will fail, because the underlying cause hasn't been
fixed.
2021-04-30 10:42:38 -07:00
Cole Helbling 03d5a858a7
Jobset: list known inputs in invalid input type response 2021-04-29 18:19:44 -07:00
Cole Helbling f1dd5d202e Jobsets: update schema to align with the API
To further align with the API, we return custom JSON in order to display a
`visible` field rather than `hidden` -- a `PUT` request expects `visible`, while
a `GET` request returns `hidden`.

This also allows us to rename the `jobsetinputs` field to `inputs` for the same
reason: `PUT` expects `inputs`, while `GET` returns `jobsetinputs`.
2021-04-29 07:50:23 -04:00
Graham Christensen 29028258e3
Merge pull request #940 from regnat/test-with-remote-dest-store
Run the tests with a remote dest store
2021-04-29 07:27:42 -04:00
Graham Christensen e1a761194f
Merge pull request #943 from regnat/include-localhost-features
Cleanup the localhost-features test
2021-04-29 07:26:50 -04:00
regnat bf3e1cf77b Disable the remote dest store for the channel test
Looks like feature is only works when the destination store is the local
store
2021-04-29 07:24:20 +02: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 305c27d3fb Move the default-machine-file test under queue-runner
Just a bit of housekeeping to keep the testsuite clean
2021-04-29 06:55:23 +02:00
regnat f61a13d2db Only add the Nix system feature to the test that requires it 2021-04-29 06:54:25 +02:00
Graham Christensen a44e5b73a8 api-test: clean up, use subtests 2021-04-28 19:41:49 -04:00
Graham Christensen 5c5b53961e fixup: api-test.t expected to pass inputs as inputs 2021-04-28 18:30:53 -04:00