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

PAO must-gather e2e test #365

Merged
merged 1 commit into from Jul 11, 2022
Merged

PAO must-gather e2e test #365

merged 1 commit into from Jul 11, 2022

Conversation

marioferh
Copy link
Contributor

@marioferh marioferh commented May 19, 2022

must-gather e2e test

Add e2e must-gather test with pre-collected data.
Untar sysinfo.tgz
Check if generated files are present

Test in local image

@openshift-ci openshift-ci bot requested review from kpouget and yanirq May 19, 2022 08:52
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 19, 2022

@marioferh: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test e2e-aws
  • /test e2e-aws-operator
  • /test e2e-gcp-pao
  • /test e2e-no-cluster
  • /test e2e-upgrade
  • /test images
  • /test unit
  • /test verify

Use /test all to run all jobs.

In response to this:

/retest e2e-no-cluster

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@marioferh marioferh mentioned this pull request Jun 6, 2022
@marioferh
Copy link
Contributor Author

/retest-required

Copy link
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

do we want to add the expanded archive, which is a pretty large tree, or do we want to add the must gather archive as a tgz, so as binary blob?

Additionally, please clarify the (very terse) "Test in local image" line

var _ = BeforeSuite(func() {
Expect(testclient.ClientsEnabled).To(BeTrue(), "package client not enabled")
// create test namespace
err := testclient.Client.Create(context.TODO(), namespaces.TestingNamespace)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need a testing namespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's copied from other suites, not sure if needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

do we have a conclusion? it seems to me the namespace is not really needed here

@yanirq
Copy link
Contributor

yanirq commented Jun 15, 2022

The test data folders are composed from long generated paths, maybe we can downsize that for better navigation if we can.
Also, will this test data always be valid for the tests ?

@marioferh
Copy link
Contributor Author

The test data folders are composed from long generated paths, maybe we can downsize that for better navigation if we can. Also, will this test data always be valid for the tests ?

this paths are generated from must-gather

Copy link
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

@jmencak Hi Jiri, we want to test must-gather. We add a bunch (quite a lot) of files here as test data. I'm not sure we want to add so many. The alternative would be to add a tar/tgz blob and unpack it when test runs. Any preference/guidance? thanks!

Expect(err).ToNot(HaveOccurred(), "failed to read sysinfo.tgz file %s: %v", snapshotName, err)
}

err = Untar(snapshotDir, snapshotName)
Copy link
Contributor

Choose a reason for hiding this comment

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

how do we do cleanup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

how was this addressed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here,

maybe it could be better but I think is enough for this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine to do this in the aftersuite. It would be better to untar into a randomly generated temporary folder (https://pkg.go.dev/os#TempDir) and remove the temporary directory straight away when the suite ends.
I think this is a further step we should do for safety and robustness (and to minimize the risk we clog the disk of the CI boxes).
In the future we can move all the snapshot handling at the same level - make temp dir and untar in beforesuite, clean up (just remove the temp dir and all its content) on aftersuite

var _ = BeforeSuite(func() {
Expect(testclient.ClientsEnabled).To(BeTrue(), "package client not enabled")
// create test namespace
err := testclient.Client.Create(context.TODO(), namespaces.TestingNamespace)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have a conclusion? it seems to me the namespace is not really needed here

@marioferh
Copy link
Contributor Author

marioferh commented Jun 17, 2022

@jmencak Hi Jiri, we want to test must-gather. We add a bunch (quite a lot) of files here as test data. I'm not sure we want to add so many. The alternative would be to add a tar/tgz blob and unpack it when test runs. Any preference/guidance? thanks!

I don't understand, I have deleted the files and uploaded sysinfo.tgz. This one is a previous PR to the next one to collect the data from the cluster. Then no files will be uploaded to test/data

@marioferh
Copy link
Contributor Author

`fromanirh 2 hours ago

do we have a conclusion? it seems to me the namespace is not really needed here`

Yes, its like that in other suites, if we need to delete, it should be done in another PR in all suites

@ffromani
Copy link
Contributor

`fromanirh 2 hours ago

do we have a conclusion? it seems to me the namespace is not really needed here`

Yes, its like that in other suites, if we need to delete, it should be done in another PR in all suites

ok, let's keep it.

Add e2e must-gather test with pre-collected data.
Untar sysinfo.tgz
Check if generated files are present

Signed-off-by: Mario Fernandez <mariofer@redhat.com>
@marioferh
Copy link
Contributor Author

/retest-required

Copy link
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

from my pov, I think we need to do a step further in how we handle the untarred snapshot, and than we're good to go. Everything else seems OK or better.

Expect(err).ToNot(HaveOccurred(), "failed to read sysinfo.tgz file %s: %v", snapshotName, err)
}

err = Untar(snapshotDir, snapshotName)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine to do this in the aftersuite. It would be better to untar into a randomly generated temporary folder (https://pkg.go.dev/os#TempDir) and remove the temporary directory straight away when the suite ends.
I think this is a further step we should do for safety and robustness (and to minimize the risk we clog the disk of the CI boxes).
In the future we can move all the snapshot handling at the same level - make temp dir and untar in beforesuite, clean up (just remove the temp dir and all its content) on aftersuite

@marioferh
Copy link
Contributor Author

marioferh commented Jun 29, 2022

@[fromanirh]

(https://github.com/fromanirh) fromanirh [3 hours ago](https://github.com/openshift/cluster-node-tuning-operator/pull/365#discussion_r909343782)

I think it's fine to do this in the aftersuite. It would be better to untar into a randomly generated temporary folder (https://pkg.go.dev/os#TempDir) and remove the temporary directory straight away when the suite ends.
I think this is a further step we should do for safety and robustness (and to minimize the risk we clog the disk of the CI boxes).
In the future we can move all the snapshot handling at the same level -

I did it like that at the very begging as in debug-tools, the issue here is we have hardoded data besides the tar file in a no tmp folder. If we untar the data in a tmp dir we have the data split in two different folders, and copy the there and the delete it is not so elegant.

For that I've changed to this way, and in the next PR when data is generated in the cluster untar all in same folder and then delete all.

@ffromani
Copy link
Contributor

ack, let's start this way then

@ffromani
Copy link
Contributor

/lgtm

@ffromani
Copy link
Contributor

/retest

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 29, 2022
@marioferh
Copy link
Contributor Author

@fromanirh PTAL please

@ffromani
Copy link
Contributor

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 11, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fromanirh, marioferh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 11, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 11, 2022

@marioferh: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-ci openshift-ci bot merged commit 86c37b0 into openshift:master Jul 11, 2022
IlyaTyomkin pushed a commit to IlyaTyomkin/cluster-node-tuning-operator that referenced this pull request May 23, 2023
Add e2e must-gather test with pre-collected data.
Untar sysinfo.tgz
Check if generated files are present

Signed-off-by: Mario Fernandez <mariofer@redhat.com>
IlyaTyomkin pushed a commit to IlyaTyomkin/cluster-node-tuning-operator that referenced this pull request Jun 13, 2023
Add e2e must-gather test with pre-collected data.
Untar sysinfo.tgz
Check if generated files are present

Signed-off-by: Mario Fernandez <mariofer@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants