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

[CI] [UI tests] [Docker example] Build and test the docker example app, streamline it for size. #1052

Merged
merged 6 commits into from
Mar 25, 2024

Conversation

marcdumais-work
Copy link
Contributor

@marcdumais-work marcdumais-work commented Mar 5, 2024

This PR adds a GitHub workflow to build and test the example trace viewer Docker application/appliance

The tests were added by integrating theia-playwright-template (*), and doing a bit of customising for the local integration. The result is a minimal UI test suite, that can be used on both the browser and Docker example applications (Electron support is also possible but was left-out for now). This is just the beginning of a test suite, that could be greatly enhanced, but it's better than nothing, specially to validate that the Docker example does not get badly broken without our knowledge.

Along with the above, the Docker example app was streamlined, both in how it's built and to minimize the Theia extensions it uses, resulting in a nice decrease in resulting image size, hopefully without diminishing its applicability as a Trace Viewer appliance.

(*) https://github.com/eclipse-theia/theia-playwright-template/tree/d30db090063f40d56b1b1687851385e8ea33b599

@marcdumais-work marcdumais-work force-pushed the ci-build-docker-image branch 30 times, most recently from f6d288c to 55f9ed0 Compare March 6, 2024 14:07
@marcdumais-work marcdumais-work marked this pull request as ready for review March 11, 2024 18:11
@marcdumais-work
Copy link
Contributor Author

@frallax : FYI

@bhufmann
Copy link
Collaborator

@marcdumais-work I added some comments to this PR.

@marcdumais-work marcdumais-work force-pushed the ci-build-docker-image branch 3 times, most recently from 70d3730 to 59b381d Compare March 19, 2024 19:18
@marcdumais-work
Copy link
Contributor Author

@marcdumais-work I added some comments to this PR.

Bernd, I made some improvements following your comments, and tried to answer your questions.

README.md Show resolved Hide resolved
bhufmann
bhufmann previously approved these changes Mar 21, 2024
Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for adding these ui tests.

Build the docker example image

Signed-off-by: Marc Dumais <[email protected]>
A few small changes that make the example docker image smaller and build a bit faster:

- Build the theia trace viewer app/appliance in "production" mode (vs development)
- Have yarn remove the installed "devDependencies" after the build ("yarn --production")
  - adapt docker-entrypoint.sh to start the app directly rather than through @theia/cli
- Remove redundant "theia build" triggered in "prepare" package.json scripts entry - it's
  also done in Dockerfile

Signed-off-by: Marc Dumais <[email protected]>
… a Trace Viewer appliance

There is not necessarily a perfect solution here - all depends on how the resulting Docker
image/appliance is intended to be used. Already, the fact that no support for vscode extension
is provided, makes this app not suitable for use in software development. If we go to the logical
conclusion, we can also remove a lot of the current @Theia framework extensions and make the app
and resulting image smaller.

One further potential improvement could be to make the trace viewer Theia extension not depend on
@theia/preferences - currently the app pulls the relatively big @theia/monaco just for that. Instead,
e.g. a static stub implementation could be used, just to set hardcoded values for the few preferences
used in this app/appliance.

Note: some extra @Theia extensions will be pulled as dependencies of the current list

Signed-off-by: Marc Dumais <[email protected]>
… a few testcases

Create a "trace viewer app" from the generic @theia/playwright "theiaApp" and add
a "trace explorer view".  Enhance test suite with some related test cases.

Signed-off-by: Marc Dumais <[email protected]>
Since we have this minimal UI test suite, let's also use it on the
browser example app.

Signed-off-by: Marc Dumais <[email protected]>
The 3PP is believed to be license-compatible, according to the Eclipse Foundation rules

Signed-off-by: Marc Dumais <[email protected]>
@marcdumais-work
Copy link
Contributor Author

Thanks for the review!

@marcdumais-work marcdumais-work merged commit 00120ac into master Mar 25, 2024
7 checks passed
@marcdumais-work marcdumais-work deleted the ci-build-docker-image branch March 25, 2024 18:45
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.

2 participants