Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [kbn-test] fix junit report test for local run (#198120) #198254

Open
wants to merge 1 commit into
base: 8.x
Choose a base branch
from

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

## Summary

When I run test locally with `node scripts/jest --config
packages/kbn-test/jest.config.js`, it fails with

```
 FAIL  packages/kbn-test/src/mocha/junit_report_generation.test.js
  ● dev/mocha/junit report generation › reports on failed setup hooks

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

    @@ -1,7 +1,7 @@
      Object {
    -   "command-line": "node scripts/jest --config=packages/kbn-test/jest.config.js --runInBand --coverage=false --passWithNoTests",
    +   "command-line": "node node_modules/jest-worker/build/workers/processChild.js",
        "failures": "2",
        "metadata-json": "{}",
        "name": "test",
        "skipped": "1",
        "tests": "4",
```

This PR uses `process.env.CI` as a condition to apply different value
for `command-line` property so test will pass locally too.

(cherry picked from commit ec72eb2)
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 30, 2024

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #12 / Templates renders correctly

Metrics [docs]

✅ unchanged

History

cc @dmlemeshko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants