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 1 commit 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 17 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.

.github/workflows/tests.yml Outdated Show resolved Hide resolved
.github/workflows/tests.yml Show resolved Hide resolved
.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
edlerd added a commit to canonical/lxd-ui that referenced this pull request Nov 15, 2024
## Done

- chore(ci) simplify tests to not rely on workflow image download

Related to canonical/lxd#14035
.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
.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
@edlerd edlerd force-pushed the add-e2e-tests branch 4 times, most recently from b1bfcad to f83f2bc Compare November 19, 2024 13:39
@tomponline
Copy link
Member

Please can this be rebased and squashed into fewer commits (perhaps only 1, depending on what you see as the logical changes in this PR), rather than each commit showing the evolution of the PR over the review. Thanks

@edlerd
Copy link
Contributor Author

edlerd commented Nov 21, 2024

Please can this be rebased and squashed into fewer commits (perhaps only 1, depending on what you see as the logical changes in this PR), rather than each commit showing the evolution of the PR over the review. Thanks

Will do this after testing this on a fork shows a successful run.

CI=true DISABLE_VM_TESTS=true LXD_DIR=/var/lib/lxd PATH=/home/runner/go/bin:$PATH npx playwright test --project chromium:lxd-latest-edge
#npx playwright test --project chromium:lxd-5.21-edge
#npx playwright test --project lxd-5.0-edge

Copy link
Member

Choose a reason for hiding this comment

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

We should probably have a step here to cleanly stop LXD via lxd shutdown so we can be sure all coverage data is written before sending it up.

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 added the lxd shutdown, but the coverage data for the ui is empty on this run on my fork. I set up the secrets over there and the e2e test suite completed just fine. Any idea what could be missing is welcome.

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 is an updated run on my fork. It still reports no coverage though.

Copy link
Member

@tomponline tomponline Nov 22, 2024

Choose a reason for hiding this comment

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

I wonder if the GOCOVERDIR env var isn't being set in your fork's run because of this line

GOCOVERDIR: ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && '/home/runner/work/lxd/lxd/coverage' || '' }}

Because its that env var that indicates to the lxd binary where to store the coverage files.

Copy link
Contributor Author

@edlerd edlerd Nov 22, 2024

Choose a reason for hiding this comment

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

I wonder if the GOCOVERDIR env var isn't being set in your fork's run because of this line

Yeah, I saw that and explicitly set GOCOVERDIR for the ui step in recent versions of the workflow.

Copy link
Member

Choose a reason for hiding this comment

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

ah, ok, but was that env var present in the lxd build step too, as that is used by LXD's makefile to build lxd with go coverage support.

Copy link
Member

@tomponline tomponline Nov 22, 2024

Choose a reason for hiding this comment

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

then relies on that env var being set here:

https://github.com/canonical/lxd/blob/main/Makefile#L43

.github/workflows/tests.yml Outdated Show resolved Hide resolved
.github/workflows/tests.yml Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
@edlerd edlerd force-pushed the add-e2e-tests branch 2 times, most recently from eb9d734 to eae5054 Compare November 22, 2024 08:48
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