Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/nginx/mock-http-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ app.use('/-/', (req, res, next) => {
next();
});

app.get('/health', (req, res) => res.send('OK'));
app.get('/request-log', (req, res) => res.json(requests));
app.get('/reset', (req, res) => {
app.get('/__mock_http_server/health', (req, res) => res.send('OK'));
app.get('/__mock_http_server/request-log', (req, res) => res.json(requests));
app.get('/__mock_http_server/reset', (req, res) => {
requests.length = 0;
res.json('OK');
});
Expand Down
4 changes: 2 additions & 2 deletions test/nginx/mock-sentry/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ app.use(express.json({
'application/reports+json', // https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/report-to#violation_report_syntax
],
}));
app.get('/event-log', (req, res) => res.json(events));
app.get('/reset', (req, res) => {
app.get('/__mock_sentry/event-log', (req, res) => res.json(events));
app.get('/__mock_sentry/reset', (req, res) => {
events.length = 0;
res.json('OK');
});
Expand Down
4 changes: 2 additions & 2 deletions test/nginx/setup-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ log "Starting test services..."
docker_compose up --build --detach

log "Waiting for mock backend..."
wait_for_http_response 5 localhost:8383/health 200
wait_for_http_response 5 localhost:8383/__mock_http_server/health 200
log "Waiting for mock enketo..."
wait_for_http_response 5 localhost:8005/health 200
wait_for_http_response 5 localhost:8005/__mock_http_server/health 200
log "Waiting for nginx..."
wait_for_http_response 5 localhost:9000 421

Expand Down
4 changes: 2 additions & 2 deletions test/nginx/src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
};

async function assertSentryReceived(...expectedRequests) {
const { status, body } = await requestSentryMock({ path:'/event-log' });
const { status, body } = await requestSentryMock({ path:'/__mock_sentry/event-log' });
assert.equal(status, 200);

const actual = JSON.parse(body);
Expand All @@ -27,7 +27,7 @@ async function assertSentryReceived(...expectedRequests) {
}

async function resetSentryMock() {
const res = await requestSentryMock({ path:'/reset' });
const res = await requestSentryMock({ path:'/__mock_sentry/reset' });
assert.equal(res.status, 200);
}

Expand Down
4 changes: 2 additions & 2 deletions test/nginx/src/mocha/nginx.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ function assertBackendReceived(...expectedRequests) {
}

async function assertMockHttpReceived(port, expectedRequests) {
const res = await request(`http://localhost:${port}/request-log`);
const res = await request(`http://localhost:${port}/__mock_http_server/request-log`);
assert.isTrue(res.ok);
assert.deepEqual(expectedRequests, await res.json());
}
Expand All @@ -1176,7 +1176,7 @@ function resetBackendMock() {
}

async function resetMock(port) {
const res = await request(`http://localhost:${port}/reset`);
const res = await request(`http://localhost:${port}/__mock_http_server/reset`);
assert.isTrue(res.ok);
}

Expand Down
Loading