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

E2E: Simplify smoke and extended tests #2871

Closed
wants to merge 14 commits into from

Conversation

tanya-borisova
Copy link
Contributor

@tanya-borisova tanya-borisova commented Nov 14, 2022

Resolves #2869

Refactor selectors in our E2E tests so that we have 3 groups of tests:

  1. Smoke tests that need to pass before a PR is merged
  2. Extended tests that will run on each push to main
  3. Performance tests that will run nightly

How this was done

  • Added extended_aad and shared_services tests to extended selector so that they run on /test-extended
  • Remove /test-shared-services and /test-extended-aad from PR bot (they can still be ran separately using a custom selector) as well as Makefile and devcontainer
  • Add a fixture for Workspace Services
  • Move all template-retrieving tests to e2e_tests/test_get_templates.py to simplify folder structure a bit
  • Change selectors so that extended tests run on every push to main and on nightly build, and performance tests run on nightly build (maybe we should consider running it weekly?)

@github-actions
Copy link

github-actions bot commented Nov 14, 2022

Unit Test Results

0 tests   0 ✔️  0s ⏱️
0 suites  0 💤
0 files    0

Results for commit 67ff46f.

♻️ This comment has been updated with latest results.

@tanya-borisova tanya-borisova marked this pull request as ready for review November 14, 2022 16:48
Copy link
Collaborator

@tamirkamara tamirkamara left a comment

Choose a reason for hiding this comment

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

Requesting changes as I don't want this PR merged before we can address my main concern: running more tests on PRs is very likely to make them harder to merge given the instability we see in Azure provisioning resources.

@@ -91,6 +92,7 @@ async def test_patch_firewall(verify):
]


@pytest.mark.extended
Copy link
Collaborator

Choose a reason for hiding this comment

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

this currently fails 100% of the time on the main branch and is very likely to fail on repeat runs at some point in PR environments.

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 was working on this another day, I managed to get Gitea deployed but I'm going to try delete it and re-deploy a couple more times. If it works, I'd like to leave it in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it still seems to be failing with the same problem "secret being recovered and can't be deleted". I will mark this test as skipped for now.

@@ -9,6 +9,7 @@
LOGGER = logging.getLogger(__name__)


@pytest.mark.extended
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since almost every other service does an internal update on the firewall, do we even need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I think we can remove this one

@@ -89,36 +89,6 @@
"false"
]
},
{
"name": "E2E Extended AAD",
Copy link
Collaborator

Choose a reason for hiding this comment

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

How does one debug a specific test?

Copy link
Contributor Author

@tanya-borisova tanya-borisova Nov 15, 2022

Choose a reason for hiding this comment

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

You couldn't do that before either though? There is still a target for E2E Extended tests, there's just no separate target for AAD.

needs.pr_comment.outputs.command == 'run-tests-extended' ||
needs.pr_comment.outputs.command == 'run-tests-extended-aad' ||
needs.pr_comment.outputs.command == 'run-tests-shared-services'
needs.pr_comment.outputs.command == 'run-tests-extended'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't the command be still available for cases where developers know what they want to test?
For example, if I change a shared service being tested I will call the run-shared-services without any of the workspace level stuff?

Copy link
Member

Choose a reason for hiding this comment

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

sort of agree - however now that workspaces + services can update those shared services, and do, there's also a case to be made that we should be running all the tests as we need to test the pipeline update from a workspace -> shared service?

Copy link
Contributor Author

@tanya-borisova tanya-borisova Nov 15, 2022

Choose a reason for hiding this comment

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

Shouldn't the command be still available for cases where developers know what they want to test?

I think a more future-proof way to do it is would be to run a workflow with a custom selector. This way we can easily extend selectors without having to update PR bot each time.

there's also a case to be made that we should be running all the tests as we need to test the pipeline update from a workspace -> shared service?

Well other bundles only really update firewall, and that will be tested by deploying said bundles. I don't think we would need to test shared services each time

@tanya-borisova
Copy link
Contributor Author

@tamirkamara

running more tests on PRs is very likely to make them harder to merge given the instability we see in Azure provisioning resources

This doesn't add any more tests that are required for a PR to pass though. Only running smoke tests is required. Given that running / test-extended is optional anyway, and we can run a custom subset of tests using a selector, is this a big concern?

@tamirkamara
Copy link
Collaborator

This doesn't add any more tests that are required for a PR to pass though. Only running smoke tests is required. Given that running / test-extended is optional anyway, and we can run a custom subset of tests using a selector, is this a big concern?

Granted - the test one hasn't changed much but I meant the extended one which is our "baseline" for the system to be functional within the PR validation.
Now extended becomes everything: gitea, firewall patch (and nexus, etc. in the future), two workspace flavors, guacamole (times 2), 2 types of VMs (linux and windows).
The question here is do we really want to do that? When we discussed this last (some months ago) we agreed to keep a balance between what runs in PR and what runs in a nightly test.
At any case, this is going to cause much more frictions to get PRs to merge and I'm not sure it's a good idea for now.

As for the custom selector, it's not relevant for many PRs as the bot doesn't (and shouldn't) expose that functionality. You must have a branch in this repo to make use of it.
Also, using a selector doesn't make the process "simpler" IMO.

@tanya-borisova
Copy link
Contributor Author

@tamirkamara I agree that a balance should be kept, my intention was mostly bringing all these additional things to extended set of tests and only mandate to run it nightly.
Is there maybe a case of bringing some tests that were previously in extended test into smoke, to really make it, as you say, baseline for the system to be functional.

Alternatively we could create a new selector, call it baseline and only add tests there that are absolutely essential for the PR to pass. (Though wouldn't there be overlap with smoke, would we need both?)

Let's discuss on the morning call tomorrow?

@tanya-borisova
Copy link
Contributor Author

We concluded that before this is useful, we should try and see if we can allow running tests with custom selector from PR bot, securely. I'm going to move it to draft for now

@tanya-borisova tanya-borisova marked this pull request as draft November 16, 2022 09:52
@tanya-borisova tanya-borisova added the blocked Cannot progress at present label Nov 16, 2022
@marrobi marrobi deleted the tborisova/simplify-smoke-extended-tests branch March 14, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Cannot progress at present
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Run more tests in e2e-extended
3 participants