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

[QE] Compactify e2e tests #3167

Merged
merged 1 commit into from
Oct 11, 2022
Merged

[QE] Compactify e2e tests #3167

merged 1 commit into from
Oct 11, 2022

Conversation

jsliacan
Copy link
Contributor

@jsliacan jsliacan commented May 9, 2022

This PR contains the following changes

@openshift-ci openshift-ci bot requested review from gbraad and praveenkumar May 9, 2022 08:26
@jsliacan jsliacan changed the title [Hold] E2e: reducing number of start/stop occasions [Hold] E2e: compactify e2e tests Jul 6, 2022
@jsliacan jsliacan changed the title [Hold] E2e: compactify e2e tests E2e: compactify e2e tests Jul 6, 2022
@jsliacan jsliacan changed the title E2e: compactify e2e tests [QE] Compactify e2e tests Jul 6, 2022
@adrianriobo
Copy link
Contributor

Does it make sense keep the clicumber integrated code under e2e?
Or may keep e2e only with suites and features and move the clicumber code to extended?

WDYT?

@jsliacan
Copy link
Contributor Author

jsliacan commented Jul 6, 2022

@adrianriobo , I moved it directly into testsuite because testsuite was "extending" the clicumber suite. That said, I am happy to put it wherever you think is better, I have no real opinions either way.

EDIT: It's in extended now as you suggested.

@jsliacan jsliacan force-pushed the e2e-speedup branch 5 times, most recently from bd7da7f to 16b5ffc Compare July 15, 2022 10:45
@jsliacan
Copy link
Contributor Author

/retest

@jsliacan jsliacan force-pushed the e2e-speedup branch 5 times, most recently from 1baf189 to a0cd8c3 Compare July 26, 2022 11:28
@anjannath
Copy link
Member

/test

@openshift-ci
Copy link

openshift-ci bot commented Aug 1, 2022

@anjannath: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

  • /test e2e-crc
  • /test images
  • /test integration-crc

Use /test all to run all jobs.

In response to this:

/test

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.

@jsliacan
Copy link
Contributor Author

/retest

@anjannath
Copy link
Member

@jsliacan pr needs rebase

@anjannath
Copy link
Member

anjannath commented Sep 28, 2022

nice speedup for e2e, integration tests!

test time e2e integration
this pr 1h52m46s 1h12m18s
in main 2h31m8s 1h23m38s

@anjannath
Copy link
Member

anjannath commented Sep 28, 2022

Include clicumber code, update dependencies, compactify feature files

i guess these three things are tightly coupled and hard to split into individual commits without rewriting the feature files multiple times for each commit.. better to also include the information in the pr description as commit log

@anjannath
Copy link
Member

anjannath commented Sep 29, 2022

leave out config.feature (should be replaced by an integration test of similar extent #3249)

@jsliacan maybe keep the config.feature for now (if it works with the current changes) and remove it when we have something similar in the integration tests? i.e when working on fixing #3249

End-to-end (e2e) tests use the link:http://github.com/code-ready/clicumber[Clicumber] package to provide basic functionality for testing CLI binaries.

Clicumber allows running commands in a persistent shell instance (`bash`, `tcsh`, `zsh`, Command Prompt, or PowerShell), assert its outputs (standard output, standard error, or exit code), check configuration files, and so on. The general functionality of Clicumber is then extended by CodeReady Containers specific test code to cover the whole functionality of CodeReady Containers.
End-to-end (e2e) tests borrow code from link:http://github.com/code-ready/clicumber[Clicumber] package to provide basic functionality for testing CLI binaries. This facilitates running commands in a persistent shell instance (`bash`, `tcsh`, `zsh`, Command Prompt, or PowerShell), assert its outputs (standard output, standard error, or exit code), check configuration files, and so on. The general functionality of Clicumber is then extended by CodeReady Containers specific test code to cover the whole functionality of CodeReady Containers.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we update /~https://github.com/code-ready/clicumber codebase to use latest version and then consume it as we are doing now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For easier maintenance etc., the idea was to include it on our side instead. I mention #3210 in the description above to hint at this.

Copy link
Member

Choose a reason for hiding this comment

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

@jsliacan which mean we are not using /~https://github.com/code-ready/clicumber anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, after this PR we won't be importing clicumber project.

@anjannath
Copy link
Member

better to exclude the config.feature changes from the first commit itself than removing it and re-adding

@jsliacan jsliacan force-pushed the e2e-speedup branch 4 times, most recently from 39ea2ac to c820548 Compare September 30, 2022 09:16
@openshift-ci openshift-ci bot added the lgtm label Sep 30, 2022
@openshift-ci
Copy link

openshift-ci bot commented Sep 30, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anjannath

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

When executing "crc setup --check-only" fails
Then executing crc start command fails
And executing single crc setup command succeeds

@linux
Copy link
Member

Choose a reason for hiding this comment

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

Why we are removing this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it because it cannot run in parallel with the rest of the scenarios in the Feature. Tagging would make it hard to read & cluttered if I included it in the next Scenario. So it's going to go in the integration test. I'll list it in the issue of things to move to integration.

# Request start with monitoring stack
* setting config property "enable-cluster-monitoring" to value "true" succeeds
* setting config property "memory" to value "16000" succeeds
Given executing crc setup command succeeds
Copy link
Member

Choose a reason for hiding this comment

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

Also now we are only testing if user provide correct mem value what about the error it display if user doesn't provide the correct mem like it use to be?

Copy link
Member

Choose a reason for hiding this comment

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

there's a separate config.feature and its covered there, so should be good i think

Copy link
Member

Choose a reason for hiding this comment

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

@anjannath I don't see any config.feature file, I think @jsliacan mentioned he will create separate task issue for those missing stuff. so once that in place we should take this PR in and iterate over.

Copy link
Member

Choose a reason for hiding this comment

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

config.feature exists from before, this was removed in an earlier iteration of the PR but the current PR branch doesn't remove that or am i missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll make an issue and it'll go into the config integration test. I don't think it's in the current config.feature. It's not the most important testcase though and the minimum we declare should work is 14GiB (docs), so maybe I'll use this value instead of 16000 that we had.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the issue with both things @praveenkumar noticed: #3249 and altered the basic.feature and config.feature a little. I moved the "missing setup" scenario to config.feature (which will be replaced by an integration test) and cleaned up scenarios a little more in basic.feature which will stay in e2e.


@darwin @linux @windows
Scenario: CRC status and disk space check
* stdout should match "(?s)(.*)oc login -u developer https:\/\/api\.crc\.testing:6443(.*)$"
Copy link
Member

Choose a reason for hiding this comment

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

what does * means because some place you used And and some place it is replaced by * ?

Copy link
Member

Choose a reason for hiding this comment

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

Gherkin also supports using an asterisk (*) in place of any of the normal step keywords. This can be helpful when you have some steps that are effectively a list of things, so you can express it more like bullet points where otherwise the natural language of And etc might not read so elegantly.

from: https://cucumber.io/docs/gherkin/reference/#Asterisk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes yes, it's just a bullet point. I use them somewhere when it's an obvious "enumeration" of things to check. But it's just for fun in a way, And would've worked just as well.

- include relevant clicumber code in this codebase, as suggested in crc-org#2538 and crc-org#3210
- update dependencies (cucumber/godog/...)
- compactify features/scenarios to fit the cucumber paradigms
@openshift-ci
Copy link

openshift-ci bot commented Oct 10, 2022

New changes are detected. LGTM label has been removed.

@praveenkumar praveenkumar merged commit 82ca273 into crc-org:main Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants