Page MenuHomeSoftware Heritage

Add a check_vault command
ClosedPublic

Authored by vlorentz on Dec 13 2019, 4:27 PM.

Details

Summary

It picks a random directory, requests its cooking from swh-web,
and waits for it to complete.

First step for T2126.

Depends on D2456 for CI to pass

Test Plan

The tests only check that the output conforms to Icinga's API to the best of my understanding of that API.

Diff Detail

Repository
rDICP Icinga plugins for SWH infrastructure
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz created this revision.Dec 13 2019, 4:27 PM
vlorentz edited the test plan for this revision. (Show Details)Dec 13 2019, 4:28 PM
vlorentz edited the summary of this revision. (Show Details)
vlorentz edited the summary of this revision. (Show Details)Dec 13 2019, 5:00 PM
vlorentz added a parent revision: D2456: Add swh-icinga-plugins.
olasd requested changes to this revision.Dec 16 2019, 2:18 PM
olasd added a subscriber: olasd.

I have the feeling that there's a way to factor out the state machine you're using for tests instead of duplicating it in all the tests.

I was about to point out that you should add a timeout, but you're adding that in a subsequent diff, so I guess that's fine.

swh/icinga_plugins/cli.py
29

I think we've usually used dashes rather than underscores here.

swh/icinga_plugins/vault.py
42

Does anything actually raise that exception?

This revision now requires changes to proceed.Dec 16 2019, 2:18 PM
In D2453#58116, @olasd wrote:

I have the feeling that there's a way to factor out the state machine you're using for tests instead of duplicating it in all the tests.

Yeah, it annoys me too, but I don't see a good way to do it

swh/icinga_plugins/cli.py
29

I was mirroring Icinga's doc instead of our conventions, but you're right.

swh/icinga_plugins/vault.py
42

oops, good catch. It will when I next update the diff

vlorentz updated this revision to Diff 8692.Dec 16 2019, 2:43 PM

apply comments

vlorentz updated this revision to Diff 8694.Dec 16 2019, 2:52 PM

fix linting

olasd accepted this revision.Dec 16 2019, 3:10 PM
This revision is now accepted and ready to land.Dec 16 2019, 3:10 PM

I have an idea, working on it

Implemented in D2462. I can merge it with this diff if you prefer.

This revision was automatically updated to reflect the committed changes.