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
Tests require a local OpenSearch running on 9200. This is unexpected for unit tests.
How can one reproduce the bug?
$ npm run test -- tools/tests/tester/TestsRunner.test.ts
> [email protected] test
> jest tools/tests/tester/TestsRunner.test.ts
FAIL tools/tests/tester/TestsRunner.test.ts
✕ stories folder (134 ms)
● stories folder
connect ECONNREFUSED ::1:9200
26 | const response: Record<string, any> = {}
27 | const [url, params] = this.#parse_url(chapter.path, chapter.parameters ?? {})
> 28 | await axios.request({
| ^
29 | url,
30 | auth: {
31 | username: 'admin',
at Function.Object.<anonymous>.AxiosError.from (node_modules/axios/lib/core/AxiosError.js:89:14)
at RedirectableRequest.handleRequestError (node_modules/axios/lib/adapters/http.js:610:25)
at ClientRequest.eventHandlers.<computed> (node_modules/follow-redirects/index.js:38:24)
at Axios.request (node_modules/axios/lib/core/Axios.js:45:41)
at ChapterReader.read (tools/src/tester/ChapterReader.ts:28:5)
at ChapterEvaluator.evaluate (tools/src/tester/ChapterEvaluator.ts:35:22)
at StoryEvaluator.#evaluate_chapters (tools/src/tester/StoryEvaluator.ts:71:28)
at StoryEvaluator.evaluate (tools/src/tester/StoryEvaluator.ts:50:22)
at TestsRunner.run (tools/src/tester/TestsRunner.ts:45:26)
at Object.<anonymous> (tools/tests/tester/TestsRunner.test.ts:20:30)
Cause:
connect ECONNREFUSED ::1:9200
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 1.42 s, estimated 2 s
What is the expected behavior?
Tests run by default should not require a server.
Do you have any additional context?
We can move some tests to integration tests, use mocks, or the new --dry-run option added in #303.
Running all tests fails with unhelpful errors.
node:internal/child_process/serialization:159
const string = JSONStringify(message) + '\n';
^
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property '_httpMessage' -> object with constructor 'Object'
--- property 'socket' closes the circle
at stringify (<anonymous>)
at writeChannelMessage (node:internal/child_process/serialization:159:20)
at process.target._send (node:internal/child_process:838:17)
at process.target.send (node:internal/child_process:738:19)
at reportSuccess (/Users/dblock/source/opensearch-project/opensearch-api-specification/dblock-opensearch-api-specification/node_modules/jest-worker/build/workers/processChild.js:82:11)
The text was updated successfully, but these errors were encountered:
The weird error message comes from Jest. I got the exact same error previously when trying to run the integ tests for the spec test framework without a docker container running. Instead of an AXIOS error being printed out (as it does when you run npm run test:spec), Jest obfuscates that error and throws TypeError: Converting circular structure to JSON instead because the AXIOS error object has cyclic references among its properties.
@nhtruong I think one idea would be to split npm run test into npm run test:unit and npm run test:integration and run only unit tests by default in npm run test. I just don't know how best to do that yet.
What is the bug?
Tests require a local OpenSearch running on 9200. This is unexpected for unit tests.
How can one reproduce the bug?
What is the expected behavior?
Tests run by default should not require a server.
Do you have any additional context?
We can move some tests to integration tests, use mocks, or the new
--dry-run
option added in #303.Running all tests fails with unhelpful errors.
The text was updated successfully, but these errors were encountered: