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

fix: CI browser/karma #2204

Merged
merged 2 commits into from
Jan 16, 2025
Merged

fix: CI browser/karma #2204

merged 2 commits into from
Jan 16, 2025

Conversation

danisharora099
Copy link
Collaborator

@danisharora099 danisharora099 commented Jan 15, 2025

Problem

Problem

Browser tests in CI are failing due to Chrome sandbox issues in the container environment. The specific error indicates that the sandbox cannot be initialized in the Ubuntu environment:

No usable sandbox! If you are running on Ubuntu 23.10+ or another Linux distro that has disabled unprivileged user namespaces with AppArmor

Additionally, Firefox tests were potentially affected by container permission issues due to missing HOME directory configuration.

Solution

  1. Updated the CI workflow to properly configure the container environment:

    • Added HOME environment variable to fix Firefox container permissions
    • Using the same container configuration as the successful Playwright tests
  2. Modified Karma configuration to use CI-specific Chrome launcher with appropriate sandbox flags:

    • Added ChromeHeadlessCI configuration with necessary flags
    • Configured browser selection to use CI-specific launchers when in CI environment

Notes

Contribution checklist:

  • covered by unit tests (existing browser tests now pass)
  • covered by e2e test (existing Playwright tests continue to pass)
  • add ! in title if breaks public API (not needed - internal CI change only)

Copy link

github-actions bot commented Jan 15, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 86.63 KB (0%) 1.8 s (0%) 2.5 s (-6.86% 🔽) 4.2 s
Waku Simple Light Node 136.82 KB (0%) 2.8 s (0%) 2.6 s (-13.23% 🔽) 5.3 s
ECIES encryption 22.88 KB (0%) 458 ms (0%) 724 ms (+44.31% 🔺) 1.2 s
Symmetric encryption 22.37 KB (0%) 448 ms (0%) 1.2 s (+33.64% 🔺) 1.6 s
DNS discovery 70.54 KB (0%) 1.5 s (0%) 2.1 s (+39.59% 🔺) 3.5 s
Peer Exchange discovery 71.82 KB (0%) 1.5 s (0%) 1.5 s (-21.24% 🔽) 2.9 s
Local Peer Cache Discovery 65.17 KB (0%) 1.4 s (0%) 2.1 s (-1.71% 🔽) 3.4 s
Privacy preserving protocols 76.16 KB (0%) 1.6 s (0%) 2 s (+2.87% 🔺) 3.5 s
Waku Filter 80.98 KB (0%) 1.7 s (0%) 2.7 s (+75.81% 🔺) 4.3 s
Waku LightPush 75.72 KB (0%) 1.6 s (0%) 1.9 s (-8.26% 🔽) 3.4 s
History retrieval protocols 77.63 KB (0%) 1.6 s (0%) 2.3 s (+21.69% 🔺) 3.8 s
Deterministic Message Hashing 7.39 KB (0%) 148 ms (0%) 435 ms (-21.29% 🔽) 583 ms

@danisharora099 danisharora099 marked this pull request as ready for review January 15, 2025 11:40
@danisharora099 danisharora099 requested a review from a team as a code owner January 15, 2025 11:40
@danisharora099 danisharora099 changed the title fix: browser tests fix: CI browser/karma Jan 15, 2025

process.env.CHROME_BIN = playwright.chromium.executablePath();
process.env.FIREFOX_BIN = playwright.firefox.executablePath();

module.exports = function (config) {
config.set({
const configuration = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: these lines actually do not change anything

Copy link
Collaborator

@weboko weboko left a comment

Choose a reason for hiding this comment

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

nice!

@danisharora099 danisharora099 merged commit ef78e52 into master Jan 16, 2025
12 of 13 checks passed
@danisharora099 danisharora099 deleted the fix/browser-tests branch January 16, 2025 07:22
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.

bug: browser tests fail in CI
2 participants