Skip to content

Commit 670da80

Browse files
fixup 2
1 parent e151c50 commit 670da80

File tree

2 files changed

+14
-61
lines changed

2 files changed

+14
-61
lines changed

.github/docker-compose.backbeat.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
version: '3.8'
22

3-
# This docker-compose is meant to be copied to your client test codebase
4-
# It sets up Backbeat with all required services using published images
5-
63
networks:
74
backbeat-net:
85
driver: bridge
@@ -35,30 +32,30 @@ services:
3532
- zookeeper
3633

3734
mongodb:
38-
image: mongo:5.0
35+
image: mongo:4.4
3936
platform: linux/amd64
4037
ports:
4138
- "27018:27018"
4239
networks:
4340
- backbeat-net
4441
command: mongod --port 27018 --replSet rs0 --bind_ip_all
4542
healthcheck:
46-
test: echo 'db.runCommand("ping").ok' | mongosh --port 27018 --quiet
43+
test: echo 'db.runCommand("ping").ok' | mongo --port 27018 --quiet
4744
interval: 10s
4845
timeout: 5s
4946
retries: 5
5047
start_period: 10s
5148

5249
mongodb-init:
53-
image: mongo:5.0
50+
image: mongo:4.4
5451
platform: linux/amd64
5552
networks:
5653
- backbeat-net
5754
depends_on:
5855
mongodb:
5956
condition: service_healthy
6057
command: >
61-
mongosh --host mongodb:27018 --eval
58+
mongo --host mongodb:27018 --eval
6259
'rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongodb:27018"}]})'
6360
restart: "no"
6461

@@ -85,9 +82,13 @@ services:
8582
- MONGODB_RS=rs0
8683
- REMOTE_MANAGEMENT_DISABLE=true
8784
- LOG_LEVEL=info
85+
- CRR_METRICS_HOST=backbeat-api
86+
- CRR_METRICS_PORT=8900
8887
depends_on:
8988
mongodb-init:
9089
condition: service_completed_successfully
90+
backbeat-api:
91+
condition: service_started
9192
healthcheck:
9293
test: ["CMD", "curl", "-f", "http://localhost:8000/"]
9394
interval: 5s

tests/testBackbeatApis.test.ts

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ import {
3535
import { createTestClient, testConfig } from './testSetup';
3636
import assert from 'assert';
3737

38-
39-
//
40-
// const AWS = require('aws-sdk');
41-
// const { Service } = require('aws-sdk');
42-
4338
// Note : these tests are relatively simple, as it's not straightforward to setup
4439
// backbeat with locations, and real pause/resume tests scenarios.
4540
// The tests in Zenko are also using these apis, and will represent an opportunity to
@@ -122,7 +117,7 @@ describe('CloudServer Check Status API Tests', () => {
122117

123118
it('should test pauseSite', async () => {
124119
const input: PauseSiteInput = {
125-
Site: 'zenko', // todo : justify
120+
Site: 'zenko', // Value from backbeat default config.json, destination.bootstrapList
126121
};
127122
const cmd = new PauseSiteCommand(input);
128123
const result = await client.send(cmd);
@@ -132,7 +127,7 @@ describe('CloudServer Check Status API Tests', () => {
132127
// No site available for ingestion on our test setup
133128
it.skip('should test pauseIngestionSite', async () => {
134129
const input: PauseIngestionSiteInput = {
135-
Site: 'a-zenko-location',
130+
Site: 'a-zenko-location', // Value from backbeat default config.json, extensions.ingestion.sources
136131
};
137132
const cmd = new PauseIngestionSiteCommand(input);
138133
const result = await client.send(cmd);
@@ -155,7 +150,7 @@ describe('CloudServer Check Status API Tests', () => {
155150

156151
it('should test resumeSite', async () => {
157152
const input: ResumeSiteInput = {
158-
Site: 'zenko', // todo : justify
153+
Site: 'zenko',
159154
};
160155
const cmd = new ResumeSiteCommand(input);
161156
const result = await client.send(cmd);
@@ -165,7 +160,7 @@ describe('CloudServer Check Status API Tests', () => {
165160
// No site available for ingestion on our test setup
166161
it.skip('should test resumeIngestionSite', async () => {
167162
const input: ResumeIngestionSiteInput = {
168-
Site: 'a-zenko-location', // todo : justify
163+
Site: 'a-zenko-location',
169164
};
170165
const cmd = new ResumeIngestionSiteCommand(input);
171166
const result = await client.send(cmd);
@@ -175,7 +170,7 @@ describe('CloudServer Check Status API Tests', () => {
175170
it('should test scheduleSiteResume', async () => {
176171
const bodyData = JSON.stringify({ hours: 24 });
177172
const input: ScheduleSiteResumeInput = {
178-
Site: 'zenko', // todo : justify
173+
Site: 'zenko',
179174
Body: new TextEncoder().encode(bodyData)
180175
};
181176
const cmd = new ScheduleSiteResumeCommand(input);
@@ -187,54 +182,11 @@ describe('CloudServer Check Status API Tests', () => {
187182
it.skip('should test scheduleIngestionSiteResume', async () => {
188183
const bodyData = JSON.stringify({ hours: 24 });
189184
const input: ScheduleIngestionSiteResumeInput = {
190-
Site: 'zenko', // todo : justify
185+
Site: 'zenko',
191186
Body: new TextEncoder().encode(bodyData)
192187
};
193188
const cmd = new ScheduleIngestionSiteResumeCommand(input);
194189
const result = await client.send(cmd);
195190
assert.strictEqual(result.$metadata.httpStatusCode, 200);
196191
});
197-
198-
// it.skip('test old client', async () => {
199-
// AWS.apiLoader.services.backbeat = {};
200-
// Object.defineProperty(AWS.apiLoader.services.backbeat, '2017-07-01', {
201-
// get: function get() {
202-
// const model = require('../legacy/zenko-2018-07-08-json.api.json');
203-
// return model;
204-
// },
205-
// enumerable: true,
206-
// configurable: true,
207-
// });
208-
// const BackbeatClient = Service.defineService('backbeat', ['2017-07-01']);
209-
210-
// BackbeatClient.prototype.validateService = function validateService() {
211-
// if (!this.config.region) {
212-
// this.config.region = 'us-east-1';
213-
// }
214-
// };
215-
// const conf = {
216-
// accessKeyId: 'accessKey1',
217-
// secretAccessKey: 'verySecretKey1',
218-
// endpoint: 'http://localhost:8000',
219-
// region: 'us-east-1',
220-
// sslEnabled: false,
221-
// s3ForcePathStyle: true,
222-
// apiVersions: { s3: '2006-03-01' },
223-
// signatureVersion: 'v4',
224-
// signatureCache: false,
225-
// };
226-
// const c = new BackbeatClient(conf)
227-
228-
// await new Promise((resolve, reject) => {
229-
// c.checkConnection({}, (err: any, data: any) => {
230-
// if (err) {
231-
// console.log('Error:', err);
232-
// reject(err);
233-
// } else {
234-
// console.log('Success:', data);
235-
// resolve(data);
236-
// }
237-
// });
238-
// });
239-
// });
240192
});

0 commit comments

Comments
 (0)