I'm doing continuous integration for my Angular (8) App.
Locally, whenever I try to run the "build" for the project, it works just fine. But when my pipeline at Atlassian Bamboo tries to build and run the tests, it's unable to start HeadlessChrome. I found many similar questions, but not one with my exact problem or a solution.
This is the error I'm getting:
Cannot start ChromeHeadless error while loading shared libraries: libXcomposite.so.1: cannot open shared object file: No such file or directory
This is my Karma conf:
module.exports = function (config) {
const process = require('process');
process.env.CHROME_BIN = require('puppeteer').executablePath();
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
...
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/idm-ui'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
'--enable-logging'
]
}
},
singleRun: false,
restartOnFileChange: true
});
};
And the command I'm running is ng test --watch=false
. Also, I have "puppeteer": "^2.1.1"
in my package.json
.
What am I doing wrong here?