Skip to content

Commit

Permalink
I have no expectation at all that this will actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-pytel committed Feb 26, 2021
1 parent a882dce commit 64235c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 30 deletions.
43 changes: 15 additions & 28 deletions tests/plugins/pg/expected.data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ segmentItems:
peer: not null
skipAnalysis: false
tags:
- key: http.url
value: http://server:5000/postgres
- key: http.method
value: GET
- key: http.status.code
value: "200"
- { key: http.url, value: 'http://server:5000/postgres' }
- { key: http.method, value: GET }
- { key: http.status.code, value: '200' }
refs:
- parentEndpoint: ""
networkAddress: server:5000
Expand All @@ -55,17 +52,14 @@ segmentItems:
spanLayer: Database
startTime: gt 0
endTime: gt 0
componentId: 5
componentId: 22
spanType: Exit
peer: postgres:3306
peer: postgres:5432
skipAnalysis: false
tags:
- key: db.type
value: Mysql
- key: db.instance
value: test
- key: db.statement
value: SELECT * FROM `user` WHERE `name` = "u1"
- { key: db.type, value: PostgreSQL }
- { key: db.instance, value: test }
- { key: db.statement, value: SELECT * FROM "user" where name = 'u1' }
- serviceName: client
segmentSize: 1
segments:
Expand All @@ -83,12 +77,9 @@ segmentItems:
peer: not null
skipAnalysis: false
tags:
- key: http.url
value: http://localhost:5001/postgres
- key: http.method
value: GET
- key: http.status.code
value: "200"
- { key: http.url, value: 'http://localhost:5001/postgres' }
- { key: http.method, value: GET }
- { key: http.status.code, value: '200' }
- operationName: /postgres
operationId: 0
parentSpanId: 0
Expand All @@ -101,11 +92,7 @@ segmentItems:
peer: server:5000
skipAnalysis: false
tags:
- key: http.url
value: server:5000/postgres
- key: http.method
value: GET
- key: http.status.code
value: "200"
- key: http.status.msg
value: OK
- { key: http.url, value: 'server:5000/postgres' }
- { key: http.method, value: GET }
- { key: http.status.code, value: '200' }
- { key: http.status.msg, value: OK }
4 changes: 2 additions & 2 deletions tests/plugins/pg/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('plugin tests', () => {
beforeAll(async () => {
compose = await new DockerComposeEnvironment(rootDir, 'docker-compose.yml')
.withWaitStrategy('client', Wait.forHealthCheck())
.withWaitStrategy('postgre', Wait.forHealthCheck())
.withWaitStrategy('postgres', Wait.forHealthCheck())
.up();
});

Expand All @@ -40,7 +40,7 @@ describe('plugin tests', () => {
});

it(__filename, async () => {
await waitForExpect(async () => expect((await axios.get('http://localhost:5001/postgre')).status).toBe(200));
await waitForExpect(async () => expect((await axios.get('http://localhost:5001/postgres')).status).toBe(200));

const expectedData = await fs.readFile(path.join(rootDir, 'expected.data.yaml'), 'utf8');

Expand Down

0 comments on commit 64235c5

Please sign in to comment.