Skip to content

Commit 28ce997

Browse files
authored
fix(configuration): remove webhooks from configuration (#386)
1 parent 6354ee6 commit 28ce997

File tree

13 files changed

+12
-128
lines changed

13 files changed

+12
-128
lines changed

docs/devguide/docs/swagger-docs.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,10 +2471,6 @@ components:
24712471
type: number
24722472
description: The minimum of time waiting for runner to report before the test considered as finished.
24732473
configured only by using API.
2474-
default_webhook_url:
2475-
type: string
2476-
description: Default webhook url to send live report statistics to, can be
2477-
configured only by using API.
24782474
delay_runner_ms:
24792475
type: number
24802476
minimum: 0
@@ -2553,10 +2549,6 @@ components:
25532549
description: Minimum acceptable score of tests, if a score is less than this value, a webhook will be sent to the threshold webhook url.
25542550
minimum: 0
25552551
maximum: 100
2556-
benchmark_threshold_webhook_url:
2557-
type: string
2558-
format: uri
2559-
description: Url to send webhooks to incase a test receives a score less than the benchmark threshold.
25602552
benchmark_weights:
25612553
additionalProperties: false
25622554
type: object

docs/openapi3.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,10 +2428,6 @@ components:
24282428
type: number
24292429
description: The minimum of time waiting for runner to report before the test considered as finished.
24302430
configured only by using API.
2431-
default_webhook_url:
2432-
type: string
2433-
description: Default webhook url to send live report statistics to, can be
2434-
configured only by using API.
24352431
delay_runner_ms:
24362432
type: number
24372433
minimum: 0
@@ -2510,10 +2506,6 @@ components:
25102506
description: Minimum acceptable score of tests, if a score is less than this value, a webhook will be sent to the threshold webhook url.
25112507
minimum: 0
25122508
maximum: 100
2513-
benchmark_threshold_webhook_url:
2514-
type: string
2515-
format: uri
2516-
description: Url to send webhooks to incase a test receives a score less than the benchmark threshold.
25172509
benchmark_weights:
25182510
additionalProperties: false
25192511
type: object

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"scripts": {
1111
"start": "node src/server.js",
12-
"unit-tests": "nyc --check-coverage --lines 93 --reporter=html --reporter=text mocha ./tests/unit-tests --recursive",
12+
"unit-tests": "nyc --check-coverage --lines 94 --reporter=html --reporter=text mocha ./tests/unit-tests --recursive",
1313
"integration-tests": "bash ./tests/integration-tests/run.sh",
1414
"local-integration-tests": "bash ./tests/integration-tests/runLocal.sh",
1515
"lint": "eslint src/**",

src/configManager/helpers/configDataMap.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ let configDataMap = {
3939
type: 'json'
4040
},
4141
[constConfig.BENCHMARK_THRESHOLD]: { value: process.env.BENCHMARK_THRESHOLD, type: 'int' },
42-
[constConfig.BENCHMARK_THRESHOLD_WEBHOOK_URL]: { value: process.env.BENCHMARK_THRESHOLD_WEBHOOK_URL, type: 'string' },
4342
[constConfig.BENCHMARK_WEIGHTS]: { value: process.env.BENCHMARK_WEIGHTS || JSON.stringify(BENCHMARK_WEIGHTS_DEFAULT), type: 'json' },
4443
[constConfig.CUSTOM_RUNNER_DEFINITION]: { value: process.env.CUSTOM_RUNNER_DEFINITION, type: 'json' }
4544

src/webhooks/models/database/cassandra/cassandraConnector.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/webhooks/models/database/databaseConnector.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/webhooks/models/webhookManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const databaseConnector = require('./database/databaseConnector');
3+
const databaseConnector = require('./database/sequelize/sequelizeConnector');
44
const { ERROR_MESSAGES } = require('../../common/consts');
55
const generateError = require('../../common/generateError');
66
const requestSender = require('../../common/requestSender');

tests/integration-tests/configManager/configHandler-test.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const updateBodyWithTypes = {
4545
},
4646
runner_memory: 256,
4747
benchmark_threshold: 20,
48-
benchmark_threshold_webhook_url: 'http://slack.com',
4948
benchmark_weights: {
5049
percentile_ninety_five: { percentage: 20 },
5150
percentile_fifty: { percentage: 30 },
@@ -68,7 +67,6 @@ const requestBody =
6867
runner_memory: 256,
6968
metrics_plugin_name: 'prometheus',
7069
default_email_address: 'string_value_default_email_address',
71-
default_webhook_url: 'string_value_default_webhook_url',
7270
influx_metrics: {
7371
host: 'string_value_influx_metrics',
7472
username: 'string_value_username',
@@ -90,7 +88,6 @@ const requestBody =
9088
},
9189
minimum_wait_for_delayed_report_status_update_in_ms: 30000,
9290
benchmark_threshold: 20,
93-
benchmark_threshold_webhook_url: 'http://slack.com',
9491
benchmark_weights: {
9592
percentile_ninety_five: { percentage: 20 },
9693
percentile_fifty: { percentage: 30 },
@@ -149,7 +146,6 @@ describe('update and get config', () => {
149146
should(response.body['smtp_server'] instanceof Object);
150147
should(response.body['smtp_server'] instanceof Number);
151148
should(response.body['benchmark_threshold'] instanceof Number);
152-
should(response.body['benchmark_threshold_webhook_url'] instanceof String);
153149
should(response.body['benchmark_weights'] instanceof Object);
154150
});
155151
});
@@ -209,7 +205,6 @@ describe('update and get config', () => {
209205
it('params below minimum', async () => {
210206
let response = await configRequestCreator.updateConfig({
211207
benchmark_threshold: 20,
212-
benchmark_threshold_webhook_url: 'http://slack.com',
213208
benchmark_weights: {
214209
percentile_ninety_five: { percentage: 50 },
215210
percentile_fifty: { percentage: 30 },
@@ -227,7 +222,6 @@ describe('update and get config', () => {
227222
it('update config fail with validation type', async () => {
228223
let response = await configRequestCreator.updateConfig({
229224
benchmark_threshold: 20,
230-
benchmark_threshold_webhook_url: 'http://slack.com',
231225
benchmark_weights: { 'tps': '10' }
232226
});
233227
should(response.statusCode).eql(400);

tests/unit-tests/configManager/configHandlerEnvVaribles-test.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,14 @@ describe('Manager config with env variables', function () {
5757
should(result.runner_memory).eql(20);
5858
should(result.runner_cpu).eql(0.35);
5959
should(result.smtp_server).eql({
60-
'from': 'smtp_from_test',
61-
'port': 'smtp_port_test',
62-
'username': 'smtp_username_test',
63-
'password': 'smtp_password_test',
64-
'timeout': '500',
65-
'rejectUnauthCerts': 'true',
66-
'secure': 'true'
60+
from: 'smtp_from_test',
61+
port: 'smtp_port_test',
62+
username: 'smtp_username_test',
63+
password: 'smtp_password_test',
64+
timeout: '500',
65+
rejectUnauthCerts: 'true',
66+
secure: 'true'
6767
});
6868
should(result.benchmark_threshold).eql(10);
69-
should(result.benchmark_threshold_webhook_url).eql('url_test');
7069
});
7170
});

tests/unit-tests/configManager/helpers/configDataMap-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ const expectedTypes = {
1919
minimum_wait_for_delayed_report_status_update_in_ms: 'int',
2020
metrics_plugin_name: 'string',
2121
default_email_address: undefined,
22-
default_webhook_url: undefined,
2322
influx_metrics: 'json',
2423
prometheus_metrics: 'json',
2524
smtp_server: 'json',
2625
delay_runner_ms: 'int',
2726
benchmark_threshold: 'int',
28-
benchmark_threshold_webhook_url: 'string',
2927
custom_runner_definition: 'json',
3028
benchmark_weights: 'json'
3129
};

0 commit comments

Comments
 (0)