-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix macOS frontend CI disconnecting issue (#2968)
This PR includes a few efforts to improve frontend CI on macOS. 1. Changed macOS CI to run on arm64 arch instead of x64. The is the main cause of disconnecting issue. 2. Upgraded testing-related packages to the latest: - karma to 6.4.4 (applied a custom fix for Chrome > 128.0.0.0.0 on macOS arm64, see my post angular/angular-cli#28271 (comment)) - jasmine-core to 5.4.0 3. Fixed many problematic test cases, including: - Empty test cases (no `it` cases). - Wrong dependency injection (especially on HttpClient should use `HttpClientTestingModule`). - Wrong global NzMessageModule import.
- Loading branch information
1 parent
1c6d095
commit 70334ae
Showing
20 changed files
with
133 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,30 +17,31 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
include: | ||
- os: macos-latest | ||
arch: arm64 | ||
- os: ubuntu-latest | ||
arch: x64 | ||
- os: windows-latest | ||
arch: x64 | ||
node-version: | ||
- 18 | ||
architecture: | ||
- x64 | ||
steps: | ||
- name: Checkout Texera | ||
uses: actions/checkout@v2 | ||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
architecture: ${{ matrix.architecture }} | ||
architecture: ${{ matrix.arch }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
core/gui/node_modules | ||
core/gui/multi-target/node_modules | ||
key: ${{ runner.os }}-yarn-cache-v6-${{ hashFiles('**/yarn.lock') }} | ||
key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node-version }}-yarn-cache-v1-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn-cache-v6- | ||
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node-version }}-yarn-cache-v1- | ||
- name: Prepare Yarn 4.5.1 | ||
run: corepack enable && corepack prepare [email protected] --activate && yarn --cwd core/gui set version 4.5.1 | ||
- name: Install dependency | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,51 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/1.0/config/configuration-file.html | ||
|
||
module.exports = function(config) { | ||
// Karma configuration file | ||
module.exports = function (config) { | ||
config.set({ | ||
basePath: "", | ||
frameworks: ['waitwebpack', "jasmine", "@angular-devkit/build-angular"], | ||
frameworks: ["jasmine", "@angular-devkit/build-angular"], | ||
plugins: [ | ||
require("karma-jasmine"), | ||
require("karma-chrome-launcher"), | ||
require("karma-coverage"), | ||
require("karma-jasmine-html-reporter"), | ||
require('./karma.waitwebpack'), | ||
require("@angular-devkit/build-angular/plugins/karma") | ||
], | ||
client: { | ||
clearContext: false, // leave Jasmine Spec Runner output visible in browser | ||
clearContext: config.singleRun, // Leave Jasmine Spec Runner output visible in the browser | ||
jasmine: { | ||
random: false // disable the random running order | ||
} | ||
random: false, // Disable random order for consistent test results | ||
}, | ||
}, | ||
customLaunchers: { | ||
ChromeHeadlessCustom: { | ||
base: 'ChromeHeadless', | ||
base: "ChromeHeadless", | ||
flags: [ | ||
'--no-sandbox', | ||
'--headless', | ||
'--disable-gpu', | ||
'--disable-translate', | ||
'--disable-extensions' | ||
"--no-sandbox", | ||
"--headless=new", | ||
"--remote-debugging-port=9222", // Enable remote debugging for better error output | ||
"--disable-gpu", | ||
"--disable-translate", | ||
"--disable-extensions", | ||
"--disable-dev-shm-usage", // Avoid /dev/shm issues in CI environments | ||
"--disable-extensions", | ||
"--disable-background-networking", | ||
"--disable-background-timer-throttling", | ||
"--disable-backgrounding-occluded-windows", | ||
"--disable-breakpad", | ||
"--disable-sync", | ||
], | ||
}, | ||
}, | ||
reporters: ["progress", "kjhtml"], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ["ChromeHeadlessCustom"], | ||
singleRun: false, | ||
captureTimeout: 240000, | ||
browserDisconnectTimeout: 60000, | ||
browserDisconnectTolerance: 1, | ||
browserNoActivityTimeout: 240000 | ||
reporters: ["dots"], // Use dots reporter | ||
port: 9876, // Karma's web server port | ||
colors: true, // Enable colors in the output (reporters and logs) | ||
logLevel: config.LOG_INFO, // Set log level | ||
autoWatch: false, // Disable auto-watch to prevent re-runs in CI | ||
concurrency: 1, // Launch only one browser at a time | ||
browsers: ["ChromeHeadlessCustom"], // Run tests in headless Chrome | ||
singleRun: true, // Ensure Karma exits after running tests once (useful for CI) | ||
restartOnFileChange: false, // Disable file change restarts in CI | ||
captureTimeout: 30000, // 30-second timeout for capturing the browser | ||
browserDisconnectTimeout: 60000, // 60-second disconnect timeout | ||
browserDisconnectTolerance: 1, // Allow up to 1 disconnect before failing | ||
browserNoActivityTimeout: 60000, // 60-second no-activity timeout | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.