diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb1fba5..b49ec5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: - run: node src/cli.js publish --slack {SLACK_MVP_URL} --title 'Unit Tests' --ci-info --chart-test-summary --junit 'results/junit.xml' if: always() env: - TEST_BEATS_API_KEY: ${{ secrets.TEST_BEATS_API_KEY }} + # TEST_BEATS_API_KEY: ${{ secrets.TEST_BEATS_API_KEY }} SLACK_MVP_URL: ${{ secrets.SLACK_MVP_URL }} - uses: actions/upload-artifact@v4 if: always() diff --git a/src/utils/config.builder.js b/src/utils/config.builder.js index 4a6fe37..9bda0b7 100644 --- a/src/utils/config.builder.js +++ b/src/utils/config.builder.js @@ -1,3 +1,6 @@ +const path = require('path'); +const logger = require('./logger'); + class ConfigBuilder { /** @@ -21,6 +24,8 @@ class ConfigBuilder { this.#buildTargets(); this.#buildExtensions(); + logger.info(`🛠️ Generated Config: ${JSON.stringify(this.config, null, 2)}`); + this.opts.config = this.config; } @@ -67,7 +72,7 @@ class ConfigBuilder { this.config.results = [ { type, - files: [file] + files: [path.join(file)] } ] } diff --git a/test/cli.spec.js b/test/cli.spec.js index e6b4111..aead452 100644 --- a/test/cli.spec.js +++ b/test/cli.spec.js @@ -7,6 +7,7 @@ describe('CLI', () => { it('publish results with config file', (done) => { mock.addInteraction('post test-summary to slack'); exec('node src/cli.js publish --config test/data/configs/slack.config.json', (error, stdout, stderr) => { + console.log(stdout); assert.match(stdout, /✅ Results published successfully!/); done(); }); @@ -15,6 +16,7 @@ describe('CLI', () => { it('publish results with config builder', (done) => { mock.addInteraction('post test-summary to slack'); exec('node src/cli.js publish --slack http://localhost:9393/message --testng test/data/testng/single-suite.xml', (error, stdout, stderr) => { + console.log(stdout); assert.match(stdout, /✅ Results published successfully!/); done(); }); @@ -23,6 +25,7 @@ describe('CLI', () => { it('publish results with config builder and extension', (done) => { mock.addInteraction('post test-summary to teams with qc-test-summary', { quickChartUrl: "https://quickchart.io" }); exec('node src/cli.js publish --teams http://localhost:9393/message --testng test/data/testng/single-suite-failures.xml --chart-test-summary', (error, stdout, stderr) => { + console.log(stdout); assert.match(stdout, /✅ Results published successfully!/); done(); }); @@ -32,6 +35,7 @@ describe('CLI', () => { mock.addInteraction('post test results to beats'); mock.addInteraction('post test-summary with beats to teams'); exec('node src/cli.js publish --api-key api-key --project project-name --run build-name --teams http://localhost:9393/message --testng test/data/testng/single-suite.xml', (error, stdout, stderr) => { + console.log(stdout); assert.match(stdout, /🚀 Publishing results to TestBeats Portal/); assert.match(stdout, /✅ Results published successfully!/); done();