1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

GitHub unit test failes on configuration using Karma

Discussão em 'Angular' iniciado por MartinF, Setembro 26, 2024.

  1. MartinF

    MartinF Guest

    I am trying to run on github pipeline and I added test section. So all tests passes but it ends with this error

    ✔ Browser application bundle generation complete.
    12 01 2024 08:38:12.950:INFO [karma-server]: Karma v6.4.2 server started at http://localhost:9876/
    12 01 2024 08:38:12.952:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
    12 01 2024 08:38:12.959:INFO [launcher]: Starting browser ChromeHeadless
    12 01 2024 08:38:16.312:INFO [Chrome Headless 120.0.6099.199 (Linux x86_64)]: Connected on socket DWOuKXQLVla7uEp-AAAB with id 43272771
    Chrome Headless 120.0.6099.199 (Linux x86_64): Executed 0 of 2 SUCCESS (0 secs / 0 secs)
    Chrome Headless 120.0.6099.199 (Linux x86_64): Executed 1 of 2 SUCCESS (0 secs / 0.076 secs)
    Chrome Headless 120.0.6099.199 (Linux x86_64): Executed 2 of 2 SUCCESS (0 secs / 0.088 secs)
    Chrome Headless 120.0.6099.199 (Linux x86_64): Executed 2 of 2 SUCCESS (0.147 secs / 0.088 secs)
    TOTAL: 2 SUCCESS
    ✔ Browser application bundle generation complete.
    ✔ Browser application bundle generation complete.
    - Generating browser application bundles (phase: setup)...
    ✔ Browser application bundle generation complete.
    12 01 2024 08:38:30.019:INFO [karma-server]: Karma v6.4.2 server started at http://localhost:9876/
    12 01 2024 08:38:30.020:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
    12 01 2024 08:38:30.023:INFO [launcher]: Starting browser ChromeHeadless
    12 01 2024 08:38:30.260:INFO [Chrome Headless 120.0.6099.199 (Linux x86_64)]: Connected on socket ZG7l0ICZB34c5IMgAAAD with id 30559897
    Chrome Headless 120.0.6099.199 (Linux x86_64): Executed 0 of 0 SUCCESS (0 secs / 0 secs)
    Chrome Headless 120.0.6099.199 (Linux x86_64): Executed 0 of 0 SUCCESS (0.009 secs / 0 secs)
    ✔ Browser application bundle generation complete.
    TOTAL: 0 SUCCESS
    ✔ Browser application bundle generation complete.
    Error: Process completed with exit code 1.


    I am not sure what does this mean and why this is happening cause locally all passes correctly

    running command is here: "test:prod": "ng test --browsers=ChromeHeadless --no-watch",

    karma.conf.js file content is here

    module.exports = function(config) {
    config.set({
    basePath: '',
    frameworks: ['jasmine'],
    files: [
    '**/*.spec.ts',
    '*.spec.ts',
    ],
    exclude: [],
    preprocessors: {
    '**/*.spec.ts': ['webpack'],
    '*.spec.ts': ['webpack'],
    },
    reporters: ['progress'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['ChromeHeadless'],
    customLaunchers: {
    ChromeHeadless: {
    base: 'Chrome',
    flags: ['--headless', '--disable-gpu', '--no-sandbox', '--remote-debugging-port=9222'],
    },
    },
    singleRun: false,
    concurrency: 2, // Adjust the concurrency level as needed
    });
    };


    tsconfig.spec.json content is here

    {
    "extends": "./tsconfig.json",
    "compilerOptions": {
    "outDir": "./out-tsc/spec",
    "types": ["jasmine", "@angular/localize"]
    },
    "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
    }

    Continue reading...

Compartilhe esta Página