Skip to content
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

tests/cri-containerd: split between cri-containerd and crictl suites #8096

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wainersm
Copy link
Contributor

@wainersm wainersm commented Oct 3, 2023

This split the cri-containerd in two suites of tests:

  • cri-containerd: keep running containerd's cri-integration tests
  • crictl: new home for the crictl-based tests

Then the crictl tests were convert to use the bats framework. I didn't want to improve the tests, depict many opportunities, so I tried to keep the original code and logic intact as much as possible. In the future, when we start pulling tests from CCv0 I think it will be the right time for improvements.

A github workflow was created to run the crictl suite of tests. The workflow won't fail due to failures on tests, because I will be able to fully test the tests on CI after the workflow is merged (right?) and then I don't want a broken workflow blocking unrelated pull requests.

Fixes #8160

@katacontainersbot katacontainersbot added the size/large Task of significant size label Oct 3, 2023
@fidencio
Copy link
Member

fidencio commented Oct 3, 2023

@wainersm, I don't understand 9c1a213

What exactly are you trying to gain with that? integration/cri-containerd should be clear that this is cri-containerd integration tests ... making it integration/cri-containerd-integration is redundant.

@wainersm
Copy link
Contributor Author

wainersm commented Oct 3, 2023

Hi @fidencio !

@wainersm, I don't understand 9c1a213

What exactly are you trying to gain with that? integration/cri-containerd should be clear that this is cri-containerd integration tests ... making it integration/cri-containerd-integration is redundant.

Once upon a time PR #8061, that @beraldoleal asked me to help understand why some CI jobs failed. I took look at https://github.com/kata-containers/kata-containers/actions/runs/6356069723/job/17266102296?pr=8061 first, when I realized that our cri-containerd suite of tests is actually running two types of tests:

  1. The containerd's cri-integration suite. External to kata's code base, writing in Golang...etc
  2. Custom shell script tests within kata's code base, using crictl/cri/containerd

So my goal is to split those two types of tests in different suites to easy the interpretation of the logs when the CI fail. The tests 2) (cri-containerd) could even growth in the future with the addition of https://github.com/kata-containers/tests/tree/CCv0/integration/containerd/confidential tests.

Let me know if I'm missing something and/or this is an unwanted/worthless split.

@wainersm
Copy link
Contributor Author

wainersm commented Oct 3, 2023

Hi @fidencio !

@wainersm, I don't understand 9c1a213
What exactly are you trying to gain with that? integration/cri-containerd should be clear that this is cri-containerd integration tests ... making it integration/cri-containerd-integration is redundant.

Once upon a time PR #8061, that @beraldoleal asked me to help understand why some CI jobs failed. I took look at https://github.com/kata-containers/kata-containers/actions/runs/6356069723/job/17266102296?pr=8061 first, when I realized that our cri-containerd suite of tests is actually running two types of tests:

1. The containerd's cri-integration suite. External to kata's code base, writing in Golang...etc

2. Custom shell script tests within kata's code base, using crictl/cri/containerd

So my goal is to split those two types of tests in different suites to easy the interpretation of the logs when the CI fail. The tests 2) (cri-containerd) could even growth in the future with the addition of https://github.com/kata-containers/tests/tree/CCv0/integration/containerd/confidential tests.

Let me know if I'm missing something and/or this is an unwanted/worthless split.

ah, and the tests 2) (cri-containerd) I'd like to convert to bats... :)

@fidencio
Copy link
Member

fidencio commented Oct 3, 2023

Aha, okay, it makes sense.

I'd just not name it as cri-containerd-integration :-)

@wainersm
Copy link
Contributor Author

wainersm commented Oct 3, 2023

Aha, okay, it makes sense.

I'd just not name it as cri-containerd-integration :-)

hmm.. what do you suggest? Keep containerd's cri-integration tests called cri-containerd and naming our custom tests something else (e.g. crictl-containerd) ? Naming is an art my friend...

@wainersm
Copy link
Contributor Author

wainersm commented Oct 3, 2023

run-cri-containerd (lts, qemu) is also failing locally and I still don´t know why.

@wainersm
Copy link
Contributor Author

wainersm commented Oct 4, 2023

run-cri-containerd (lts, qemu) is also failing locally and I still don´t know why.

Fixed. Added an instruction to pull the pause image before creating the pod.

@katacontainersbot katacontainersbot added size/huge Largest and most complex task (probably needs breaking into small pieces) and removed size/large Task of significant size labels Oct 4, 2023
@wainersm
Copy link
Contributor Author

wainersm commented Oct 4, 2023

Re-done my initial PR to move the crictl tests to its own suite (guess what, named crictl). So the cri-containerd suite is kept running the containerd's cri-integration tests.

Once CI passing I should be working on:

  • convert crictl to use bats
  • create a new CI job to run crictl only

@wainersm wainersm force-pushed the refactor_cri-containerd branch 2 times, most recently from 911c12c to 9e05f86 Compare October 6, 2023 20:46
@wainersm wainersm changed the title [WIP] Refactor cri-containerd tests suite tests/cri-containerd: split between cri-containerd and crictl suites Oct 6, 2023
@wainersm
Copy link
Contributor Author

wainersm commented Oct 6, 2023

@fidencio this PR is ready to review. The three commits that convert to bats I should squash after the reviews (keeping them separated to ease the reviewer's life).
/ ----
/ ------
@stevenhorsman tentative to build a | [] | (house) for the crictl tests that we will (or not) be pulling to main...

@wainersm
Copy link
Contributor Author

wainersm commented Oct 6, 2023

@fidencio this PR is ready to review. The three commits that convert to bats I should squash after the reviews (keeping them separated to ease the reviewer's life). / ---- / ------ @stevenhorsman tentative to build a | [] | (house) for the crictl tests that we will (or not) be pulling to main...

yeah, my tentative to build a house in ascii didn't work out....

@wainersm wainersm added no-backport-needed area/testing Issues related to testing labels Oct 6, 2023
@stevenhorsman
Copy link
Member

 / ---- \
/ ------ \
  | [] |

Copy link
Member

@stevenhorsman stevenhorsman left a comment

Choose a reason for hiding this comment

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

Looks good to me, one minor comment...

tests/integration/crictl/lib.sh Show resolved Hide resolved
Created the tests/integration/cri-containerd/lib.sh file to host code
that can be shared with other tests suites.

The original code wasn't touched, it just moved of place. In preparation
to create the crictl suite of tests.

Fixes kata-containers#8160
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
The tests/integration/cri-containerd currently runs the containerd's
cri-integration tests plus a couple of kata's specific tests using
crictl. Splited in two suites of tests:

 * cri-containerd - keep running the containerd's cri-integration tests
 * crictl - new home for crictl based tests

The code is essentially a copy of
 * cri-containerd/integration-tests.sh ->
   crictl/run_tests.sh
 * cri-containerd/gha-run.sh ->
   crictl/gha-run.sh

On crictl/run_tests.sh, `testContainerStart()` was added a handler to
pull the pause image before creating the pod.

Fixes kata-containers#8160
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Re-implemented the tests to use the bats framework.

Fixes kata-containers#8160
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Added a new workflow to run the tests/integration/crictl suite of tests
with same containerd/hypervisor matrix as cri-containerd workflow.

Important: at this point the workflow won't fail due to failing tests.

Fixes kata-containers#8160
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
@wainersm
Copy link
Contributor Author

Rebase this to main, added a header to tests/integration/crictl/lib.sh and squashed the commits that convert tests to bats.

@stevenhorsman
Copy link
Member

@wainersm - Do we still want to get this in? I think it needs a rebase and re-test and then we can have another attempt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Issues related to testing size/huge Largest and most complex task (probably needs breaking into small pieces)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests: split the cri-containerd tests
4 participants