You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Karma is used to run unit test cases in one of my Angular applications. If you run it locally with the configuration shown below, there are no problems, however if you use CI/CD, you are now seeing the error message "No binary for Chrome browser on your platform. Please set the environment variable "CHROME_BIN"
Karma.conf.js: module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), require('karma-coverage'), require('@angular-devkit/build-angular/plugins/karma') ], client: { clearContext: false ,// leave Jasmine Spec Runner output visible in browser jasmine: { random: false } }, coverageIstanbulReporter: { dir: require('path').join(__dirname, '../coverage'), reports: ['html', 'lcovonly'], fixWebpackSourcePaths: true }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: true, customLaunchers: { ChromeHeadlessCI: { base: 'ChromeHeadless', flags: [ '--no-sandbox' ] } } }); };
And I attempted to set CHROME_BIN with Puppeteer as seen below after going through a few references, but I'm now encountering a different kind of problem. The problem with Puppeteer is that
`11 09 2023 10:49:24.520:ERROR [config]: Error in config file!
Error: Could not find Chrome (ver. 116.0.5845.96). This can occur if either
you did not perform an installation before running the script (e.g. npm install) or
your cache path is incorrectly configured (which is: /opt/app-root/src/.cache/puppeteer).`
And this is the current Karma config file with Puppeteer. process.env.CHROME_BIN = require('puppeteer').executablePath() module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: ['karma-jasmine', 'karma-chrome-launcher', require('karma-jasmine-html-reporter'), require('karma-chrome-launcher'), require('karma-coverage-istanbul-reporter'), require('karma-coverage'), require('@angular-devkit/build-angular/plugins/karma') ], client: { clearContext: false ,// leave Jasmine Spec Runner output visible in browser jasmine: { random: false } }, coverageIstanbulReporter: { dir: require('path').join(__dirname, '../coverage'), reports: ['html', 'lcovonly'], fixWebpackSourcePaths: true }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome', 'ChromeHeadless', 'ChromeHeadlessCI'], singleRun: true, customLaunchers: { ChromeHeadless: { base: 'ChromeHeadless', flags: [ '--headless', '--disable-gpu', '--no-sandbox', '--remote-debugging-port=9222', ] } } }); };
Can somebody help me understand whether there need to be any configuration adjustments made to the appropriate CI/CD in github?
The text was updated successfully, but these errors were encountered:
Karma is used to run unit test cases in one of my Angular applications. If you run it locally with the configuration shown below, there are no problems, however if you use CI/CD, you are now seeing the error message "No binary for Chrome browser on your platform. Please set the environment variable "CHROME_BIN"
Karma.conf.js:
module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), require('karma-coverage'), require('@angular-devkit/build-angular/plugins/karma') ], client: { clearContext: false ,// leave Jasmine Spec Runner output visible in browser jasmine: { random: false } }, coverageIstanbulReporter: { dir: require('path').join(__dirname, '../coverage'), reports: ['html', 'lcovonly'], fixWebpackSourcePaths: true }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: true, customLaunchers: { ChromeHeadlessCI: { base: 'ChromeHeadless', flags: [ '--no-sandbox' ] } } }); };
And I attempted to set CHROME_BIN with Puppeteer as seen below after going through a few references, but I'm now encountering a different kind of problem. The problem with Puppeteer is that
`11 09 2023 10:49:24.520:ERROR [config]: Error in config file!
Error: Could not find Chrome (ver. 116.0.5845.96). This can occur if either
npm install
) orAnd this is the current Karma config file with Puppeteer.
process.env.CHROME_BIN = require('puppeteer').executablePath() module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: ['karma-jasmine', 'karma-chrome-launcher', require('karma-jasmine-html-reporter'), require('karma-chrome-launcher'), require('karma-coverage-istanbul-reporter'), require('karma-coverage'), require('@angular-devkit/build-angular/plugins/karma') ], client: { clearContext: false ,// leave Jasmine Spec Runner output visible in browser jasmine: { random: false } }, coverageIstanbulReporter: { dir: require('path').join(__dirname, '../coverage'), reports: ['html', 'lcovonly'], fixWebpackSourcePaths: true }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome', 'ChromeHeadless', 'ChromeHeadlessCI'], singleRun: true, customLaunchers: { ChromeHeadless: { base: 'ChromeHeadless', flags: [ '--headless', '--disable-gpu', '--no-sandbox', '--remote-debugging-port=9222', ] } } }); };
Can somebody help me understand whether there need to be any configuration adjustments made to the appropriate CI/CD in github?
The text was updated successfully, but these errors were encountered: