Skip to content

USHIFT-966 USHIFT-973: microshift e2e test suite#1557

Merged
openshift-merge-robot merged 45 commits intoopenshift:mainfrom
pmtk:merge-e2e-tests
Apr 11, 2023
Merged

USHIFT-966 USHIFT-973: microshift e2e test suite#1557
openshift-merge-robot merged 45 commits intoopenshift:mainfrom
pmtk:merge-e2e-tests

Conversation

@pmtk
Copy link
Member

@pmtk pmtk commented Mar 23, 2023

No description provided.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 23, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 23, 2023

@pmtk: GitHub didn't allow me to request PR reviews from the following users: pmtk.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/cc

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.

@pmtk
Copy link
Member Author

pmtk commented Mar 23, 2023

being tested in openshift/release#37629

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

Choose a reason for hiding this comment

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

Can we split these test scripts up so it is possible to run them against a local deployment, too?

@pmtk pmtk force-pushed the merge-e2e-tests branch from d47b007 to 5118527 Compare March 30, 2023 09:44
Copy link
Contributor

Choose a reason for hiding this comment

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

At what point can this script just become a call to sos report?

Copy link
Contributor

Choose a reason for hiding this comment

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

As soon as the sos version we need is publicly available this script may be retired.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't remember the details, but I think we still don't have everything in SOS? Does it have "feature parity" with the cluster-debug-info.sh?

Copy link
Member Author

Choose a reason for hiding this comment

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

I take ^ back. Just looked at sos from master and it's pretty dope.
@dhellmann @pacevedom what do you think about leaving couple commands in the job log to have quickly glanceable info in case of error? Like oc get {pods,nodes} and maybe oc get events -A --sort-by=.metadata.creationTimestamp | head -n 20. Given our problems with topolvm image pulling I'd get quickly annoyed to go through downloading and extracting sos report only to find that issue there :P

e2e/main.sh Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Passing shell commands to ssh to run with pipes and loops and things can make quoting pretty messy. Can we process the output of the script outside of ssh? Or can we make the script being run produce just the output we want (maybe via a command line switch)?

We also, at one point, talked about just copying all of the test code into the VM and then running everything there. I can see some issues with that, but the appeal is that is simplifies the test runner logic, at least in some cases. Does it make the implementation of the tests harder, though?

Copy link
Member Author

Choose a reason for hiding this comment

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

I feel that tests like router/lb smokes would not be as sane ran from within.
Also - reboot test (which I haven't ported(? - there's nothing to port there actually...) yet)

I know that current state of the PR is "in between" approaches, but I didn't wanted to make too many changes to existing tests (esp greenboot) hoping for iterative approach.

Re that monstrosity after pipe - it just adds timestamp to beginning of the line, somehow I couldn't find moreutils package on RHEL (which would provide ts and that would be much simpler).
Also, it's not needed at all - just put it there because I noticed that greenboot check takes way too long (pod restart check takes 50s for each namespace sequentially)

Copy link
Member Author

Choose a reason for hiding this comment

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

I just remembered testing I've done simulating "power loss during initialization" - test similar to this (or just "do 100 reboots") has no place running from the microshift itself.

Having external tests runner feels cleaner to me, but there's nothing prohibiting the test suite from the microshift (like selected tests running on dev vm against dev vm), but that's probably not what you meant?
Are we talking about test runner on dev VM or just having test cases in scripts, copied to remote and executed there? Even though bash scripts are much simpler at times due to being native to shell (duh) or set -x providing full debug info, they feel like a mess.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sorry, yes, you've pointed out that reboot case to me a few times before, and I keep forgetting it.

I'm trying to minimize the complexity of the commands embedded in the ssh arguments. Maybe we can isolate just those cases as temporary scripts? A guideline like "if you wouldn't type it on the command line, don't pass it to ssh as an argument" could give us a heuristic. Maybe that's stricter than needed, though?

@pmtk pmtk changed the title WIP microshift specific tests WIP USHIFT-966 USHIFT-973: microshift e2e test suite Apr 5, 2023
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 5, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 5, 2023

@pmtk: This pull request references USHIFT-973 which is a valid jira issue.

Details

In response to this:

/cc

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.

@pmtk pmtk force-pushed the merge-e2e-tests branch 4 times, most recently from 2023943 to c642ae8 Compare April 5, 2023 15:42
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 5, 2023
@pmtk
Copy link
Member Author

pmtk commented Apr 6, 2023

/label tide/merge-method-squash

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 6, 2023
@pmtk pmtk force-pushed the merge-e2e-tests branch from 38fd063 to 0366f16 Compare April 6, 2023 13:40
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 6, 2023
@pmtk pmtk changed the title WIP USHIFT-966 USHIFT-973: microshift e2e test suite USHIFT-966 USHIFT-973: microshift e2e test suite Apr 6, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 6, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 6, 2023

@pmtk: This pull request references USHIFT-973 which is a valid jira issue.

Details

In response to this:

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.

Copy link
Contributor

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

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

I'm happy with this version. I'll leave the PR open to let some of the rest of the team look at it, since there are others who have been following the work more closely than I have.

e2e/main.sh Outdated
set -euo pipefail

SCRIPT_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"
OUTPUT_DIR="${ARTIFACT_DIR:-_output}/microshift-e2e-$(date +'%Y%m%d-%H%M%S')/"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make the default _output value relative to the SCRIPT_DIR so that it's a full path?

echo ""
echo " Script expects two environmental variables:"
echo " - USHIFT_IP"
echo " - USHIFT_USER"
Copy link
Contributor

@ggiguash ggiguash Apr 10, 2023

Choose a reason for hiding this comment

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

Can we set 127.0.0.1 and microshift defaults for those? This should facilitate easier local execution of the scripts on the dev machine.

Copy link
Contributor

Choose a reason for hiding this comment

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

There will be a class of tests that cannot be run locally (anything requiring a reboot, for example. That won't be all of the tests, but for ease of development of the test suite we should be consistent with running the tests remotely.

@pmtk
Copy link
Member Author

pmtk commented Apr 11, 2023

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 11, 2023
@pmtk pmtk force-pushed the merge-e2e-tests branch from a67a2be to 61e5218 Compare April 11, 2023 11:23
@pmtk
Copy link
Member Author

pmtk commented Apr 11, 2023

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 11, 2023
@ggiguash
Copy link
Contributor

I'm approving this PR and putting it on hold. Please unhold when ready to merge.
/lgtm
/hold
/retest

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 11, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 11, 2023
@pmtk
Copy link
Member Author

pmtk commented Apr 11, 2023

/test e2e-router-smoke-test

@pmtk pmtk force-pushed the merge-e2e-tests branch from 61e5218 to ebc0c97 Compare April 11, 2023 13:17
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 11, 2023
Comment on lines +104 to +109
ssh_cmd 'cat << EOF | sudo tee /etc/microshift/config.yaml
---
apiServer:
subjectAltNames:
- '"${USHIFT_IP}"'
EOF' &>"${output_dir}/0001-setup.log"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed? Should it remain as part of the installation?

Copy link
Member Author

Choose a reason for hiding this comment

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

But it's only done in CI, missing for local VMs (unless someone does it manually). I'd prefer using IPs over hostnames if we can

Copy link
Contributor

Choose a reason for hiding this comment

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

Tests only require a host for the execution, be that a hostname or an IP, right? I would put the requirement on configuring the system outside of the tests so that they are generic for any environment.
In CI you have that as part of the install steps, and in a dev environment you may get away with default configuration. For example, I use "microshift-rhel9" as hostname for my VM and never use its IP, therefore the default config is ok.

@pmtk
Copy link
Member Author

pmtk commented Apr 11, 2023

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 11, 2023
@dhellmann
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 11, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhellmann, ggiguash, pmtk

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [dhellmann,ggiguash,pmtk]

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 11, 2023

@pmtk: all tests passed!

Full PR test history. Your PR dashboard.

Details

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-merge-robot openshift-merge-robot merged commit 5c81392 into openshift:main Apr 11, 2023
@pmtk pmtk deleted the merge-e2e-tests branch April 12, 2023 06:26
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants