Skip to content

Commit

Permalink
test: add overview of ports used by tests suites
Browse files Browse the repository at this point in the history
Also, make the legacy package test suite use different ports from the
@instana/collector suite to avoid port conflicts.
  • Loading branch information
basti1302 committed Jun 8, 2021
1 parent ed8cbe2 commit 4c95670
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/legacy-sensor/test/api/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ const expect = require('chai').expect;
const config = require('../../../core/test/config');
const testUtils = require('../../../core/test/test_util');
const ProcessControls = require('../../../collector/test/test_util/ProcessControls');
const AgentStubControls = require('../../../collector/test/apps/agentStubControls').AgentStubControls;

describe('legacy sensor/API', function () {
this.timeout(config.getTestTimeout());

const agentControls = require('../../../collector/test/apps/agentStubControls');
const agentControls = new AgentStubControls(5210);
agentControls.registerTestHooks();

const controls = new ProcessControls({
dirname: __dirname,
port: 5215,
agentControls
}).registerTestHooks();

Expand Down
4 changes: 3 additions & 1 deletion packages/legacy-sensor/test/metrics/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ const _ = require('lodash');
const config = require('../../../core/test/config');
const testUtils = require('../../../core/test/test_util');
const ProcessControls = require('../../../collector/test/test_util/ProcessControls');
const AgentStubControls = require('../../../collector/test/apps/agentStubControls').AgentStubControls;

describe('legacy sensor/metrics', function () {
this.timeout(config.getTestTimeout());

const agentControls = require('../../../collector/test/apps/agentStubControls');
const agentControls = new AgentStubControls(5210);
agentControls.registerTestHooks();

const controls = new ProcessControls({
dirname: __dirname,
port: 5215,
agentControls
}).registerTestHooks();

Expand Down
7 changes: 5 additions & 2 deletions packages/legacy-sensor/test/tracing/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ const ProcessControls = require('../../../collector/test/test_util/ProcessContro

const config = require('../../../core/test/config');
const testUtils = require('../../../core/test/test_util');
const AgentStubControls = require('../../../collector/test/apps/agentStubControls').AgentStubControls;

const serverPort = 3216;
const clientPort = 5215;
const serverPort = 5216;

let agentControls;

Expand All @@ -24,7 +26,7 @@ describe('legacy sensor/tracing', function () {
return;
}

agentControls = require('../../../collector/test/apps/agentStubControls');
agentControls = new AgentStubControls(5210);

this.timeout(config.getTestTimeout() * 2);

Expand All @@ -38,6 +40,7 @@ describe('legacy sensor/tracing', function () {

const clientControls = new ProcessControls({
appPath: path.join(__dirname, 'clientApp'),
port: clientPort,
agentControls,
env: {
SERVER_PORT: serverPort
Expand Down
19 changes: 19 additions & 0 deletions test-suite-ports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Port Ranges for Test Suites
===========================

The integration test suites for individual packages (collector, aws-fargate, aws-lambde, google-cloud-run, ...) run concurrently on CI, so we need to make sure there are no port conflicts between those.

For this reason, we maintain an overview of the ports used by the integration test suites of all packages. To avoid port conflicts, this needs to include the ports for applications under test as well as auxilliary applications like agent mocks, back end mocks, proxies etc. and infrastructure componentes running in containers (databases, message brokers, ...).

| Package | Port Range |
| -------------------- | ---------- |
| aws-fargate | app under test: 4215, mock back end: 9443, downstream dummy: 4567, metadata endpoint mock: 1604, proxy 4128 |
| aws-lambda | mock back end: 8443, mock Lambda extension: 7365, downstream dummy: 3456, proxy: 3128 |
| collector | apps under test: 3000, 3213-3217, 3222, 4200-4203; mock agent: 3210,3211, PostgreSQL: 5432, MongoDB: 27017, MSSQL: 1433, Elasticsearch: 9200, Redis: 6379, NATS: 4222, 4223, Kafka: 9092, RabbitMQ: 5672, GRPC: 50051 |
| core | N.A. (no integration tests, only unit tests) |
| google-cloud-run | app under test: 4216, mock back end: 9444, downstream dummy: 4568, metadata endpoint mock: 1605, proxy: N.A. (no proxy tests) |
| legacy-sensor | apps under test: 5215, 5216; mock agent: 5210 |
| metrics-util | N.A. (no integration tests, only unit tests) |
| serverless | N.A. (no integration tests, only unit tests) |
| shared-metrics | N.A. (no integration tests, only unit tests) |

0 comments on commit 4c95670

Please sign in to comment.