-
Notifications
You must be signed in to change notification settings - Fork 72
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
a2aaf66
commit fd30d60
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
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.