Skip to content

[Tigron]: expect.JSON comparator and updated volume test #4079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 14, 2025

Conversation

apostasie
Copy link
Contributor

@apostasie apostasie commented Apr 3, 2025

<!> Blocked by <!>:


This is a new series of Tigron PRs.

Now that the big change with the new command implementation is in, upcoming work on Tigron will focus on:

  • P0: internal testing, getting to the point we can absolutely trust Tigron to never faceplant
  • P0: debugging output readability and other developers quality of life improvements
  • P1: code cleanup and simplification

Ideally, none of these PRs will require ANY change in nerdctl, and are either changes to the way we test Tigron itself, or refactoring that does not change signatures and API.

Efforts are being made to break these PRs down into small, digestible changes to ease and fasten review, which explains the chain of PRs.

LMK at any point if a given PR needs to be further broken down.


This third PR is small as well (most of it is documentation)

Commit 1 adds support for expect.JSON[T].

The point is to remove repeated json unmarshalling boilerplate from tests.
Parsing JSON of course is not complex, but it adds unnecessary noise to tests.
Also added a detailed doc.

Second commit does change a couple of tests in nerdctl to demonstrate usage on volume tests.
If we are happy with the direction this is going to, I will cleanup more helpers and tests in a follow-up PR.

Third commit is unrelated to expect.JSON, but does fix a condition that triggered a failure on this specific PR, and is a minor test adjustment.

@apostasie apostasie force-pushed the tigron-3-json-comparator branch 7 times, most recently from 9f2f884 to b9eecf1 Compare April 3, 2025 23:27
@apostasie apostasie changed the title [BLOCKED] [Tigron]: expect.JSON comparator and updated volume test [STACKED] [Tigron]: expect.JSON comparator and updated volume test Apr 3, 2025
@apostasie apostasie marked this pull request as ready for review April 4, 2025 05:02
@apostasie apostasie force-pushed the tigron-3-json-comparator branch from b9eecf1 to 8afa7ab Compare April 8, 2025 15:59
@apostasie
Copy link
Contributor Author

Rebased.

@apostasie apostasie force-pushed the tigron-3-json-comparator branch 4 times, most recently from e924b07 to d84e7d1 Compare April 14, 2025 01:06
@apostasie apostasie changed the title [STACKED] [Tigron]: expect.JSON comparator and updated volume test [Tigron]: expect.JSON comparator and updated volume test Apr 14, 2025
@apostasie
Copy link
Contributor Author

Rebased & ready for review.
Pending CI.

@apostasie
Copy link
Contributor Author

apostasie commented Apr 14, 2025

#4046 is getting annoying.

TestBuilder(/Debug) are all NoParallel: true, so, pressure cannot be from concurrency.

So, either the timeout is just too short (3 seconds) for the size of our GHA instances: https://github.com/ktock/buildg/blob/main/pkg/buildkit/client.go#L83

... or something else gets stuck in some cases.

Exploring a hunch and a workaround in #4103.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM but a couple of documentation nits

@apostasie apostasie force-pushed the tigron-3-json-comparator branch from d84e7d1 to d039311 Compare April 14, 2025 18:01
This changeset adds expect.JSON[T any], which will allow easier testing of json output and hopefully
remove a lot of boilerplate unmarshalling / assert in tests.

It also adds an extensive doc.md document about comparators (plan is trim down the main documentation
to a small set of simple examples, then link to these "advanced" docs for further reading), which
will allow for easier documentation maintenance and more approachable reading.

Signed-off-by: apostasie <[email protected]>
In some cases, exec is just really slow.
Adjusting tests so that we start counting after the command actually started.

Signed-off-by: apostasie <[email protected]>
@apostasie apostasie force-pushed the tigron-3-json-comparator branch from d039311 to 9255358 Compare April 14, 2025 18:03
@apostasie apostasie requested a review from AkihiroSuda April 14, 2025 18:04
@apostasie
Copy link
Contributor Author

Thanks @AkihiroSuda

@AkihiroSuda
Copy link
Member

CI not running?

Workflow runs completed with no jobs

https://github.com/containerd/nerdctl/pull/4079/checks

@AkihiroSuda AkihiroSuda reopened this Apr 14, 2025
@AkihiroSuda AkihiroSuda added this to the v2.0.5 milestone Apr 14, 2025
@AkihiroSuda AkihiroSuda added the area/ci e.g., CI failure label Apr 14, 2025
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@apostasie
Copy link
Contributor Author

CI not running?

Workflow runs completed with no jobs

https://github.com/containerd/nerdctl/pull/4079/checks

Yeah I saw that the other day on another PR.
Very confusing.
I assume it is a github actions fluke but let’s keep an eye on it.

@AkihiroSuda AkihiroSuda merged commit 3a35911 into containerd:main Apr 14, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci e.g., CI failure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants