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

Add workflow to run e2e tests from lxd-ui #14035

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

Conversation

edlerd
Copy link
Contributor

@edlerd edlerd commented Sep 3, 2024

Added a step to the GitHub test workflow, executing the e2e test suite from lxd-ui with a lxd backend built from the current branch from a PR or main branch.

We might extend this on the stable-5.21 and stable-5.0 branches, as we have dedicated test suites in lxd-ui for those. For older versions, we should continue skipping the e2e tests. I'd keep this as a second step in a followup PR.

This was successful on a fork, i.e. see this run.

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

Hi @edlerd please can you work with @simondeziel to update this to use the pre-built LXD binaries we now have (that are compiled during the Code Tests phase) and to use the re-usable workflows for performance tuning and dependency installation.

Also i'd like to avoid building the docs twice, but they are built into the tarball i believe during the Code Tests phase so may be available already now.

@edlerd edlerd force-pushed the add-e2e-tests branch 14 times, most recently from 6f77ba3 to df58339 Compare November 13, 2024 19:07
@edlerd
Copy link
Contributor Author

edlerd commented Nov 13, 2024

@simondeziel @tomponline Updated the workflow to consume the build artefacts from previous steps. Please give it another review.

@edlerd
Copy link
Contributor Author

edlerd commented Nov 13, 2024

Also using the docs artefact by depending and downloading on that build step.

LXD_OIDC_ISSUER: "https://dev-xjrvvfikbsv4jxn7.us.auth0.com/"
LXD_OIDC_AUDIENCE: "https://dev-xjrvvfikbsv4jxn7.us.auth0.com/api/v2/"
LXD_OIDC_USER: "[email protected]"
LXD_OIDC_PASSWORD: "lxd-ui-e2e-password"
Copy link
Member

Choose a reason for hiding this comment

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

This shouldnt be hardcoded into the test file, as it references an external service, and thus is a real password.

We should now change this password to something else and then securely transfer it to me so we can set it up as a GH secret.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a dedicated free account, specially created for e2e tests. It is expected to be public. I don't see a reason for this to be kept secret.

Though once we start using the local OIDC service, we can remove this.

Copy link
Member

Choose a reason for hiding this comment

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

Hrm, yeah, but we shouldnt be making the credentials public

@@ -494,6 +494,240 @@ jobs:
name: lxd-clients-${{ runner.os }}
path: bin/

ui:
Copy link
Member

Choose a reason for hiding this comment

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

please can you move this as part of the system-tests: workflow and make it a step after name: "Run system tests (${{ matrix.suite }}, ${{ matrix.backend }})" and before name: Upload coverage data

Then we can re-use the dependency install deps, and by ensuring LXD is run with the code coverage env var, we can collect coverage data from the UI tests too.

Copy link
Contributor Author

@edlerd edlerd Nov 14, 2024

Choose a reason for hiding this comment

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

This will slow down LXD test runtime. With current changes from this PR, the UI tests run in parallel to the system tests, which will not affect your total runtime. Because system tests take longer than the UI tests. I think a better option is to also record coverage in the UI step and download both coverage reports in the TICS step.

.github/workflows/tests.yml Outdated Show resolved Hide resolved
env:
ENVIRONMENT: devel
PORT: 8407
LXD_UI_BACKEND_IP: 172.17.0.1
Copy link
Member

Choose a reason for hiding this comment

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

Could that be one of the loopback IPs instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ui is is running in a container, so we need to use this to reach out from the container that is running the ui. Loopback would be inside the container and not reach lxd which runs on the host.

.github/workflows/tests.yml Outdated Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants