Skip to content

Commit

Permalink
Remove all logs and testing env changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
busma13 committed Nov 2, 2023
1 parent afb04f9 commit 8ce6270
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 195 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/testK8sOnly.yml

This file was deleted.

4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"test:debug": "TEST_ELASTICSEARCH='true' TEST_KAFKA='true' ts-scripts test --suite e2e --debug --",
"test:elasticsearch6": "TEST_ELASTICSEARCH='true' TEST_KAFKA='true' ts-scripts test --suite e2e --",
"test:elasticsearch7": "TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' TEST_KAFKA='true' ts-scripts test --suite e2e --",
"test:k8s": "TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' KAFKA_VERSION='3.1' TEST_KAFKA='true' TEST_PLATFORM='kubernetes' DEBUG='*' ts-scripts test --suite e2e --debug --",
"test:k8sNoBuild": "SKIP_DOCKER_BUILD_IN_E2E='true' TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' KAFKA_VERSION='3.1' TEST_KAFKA='true' TEST_PLATFORM='kubernetes' DEBUG='*' ts-scripts test --suite e2e --debug -- --silent=false",
"test:k8s": "TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' KAFKA_VERSION='3.1' TEST_KAFKA='true' TEST_PLATFORM='kubernetes' ts-scripts test --suite e2e --",
"test:k8sNoBuild": "SKIP_DOCKER_BUILD_IN_E2E='true' TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' KAFKA_VERSION='3.1' TEST_KAFKA='true' TEST_PLATFORM='kubernetes' ts-scripts test --suite e2e --",
"test:opensearch1": "TEST_OPENSEARCH='true' TEST_KAFKA='true' ts-scripts test --suite e2e --",
"test:opensearch2": "TEST_OPENSEARCH='true' OPENSEARCH_VERSION='2.8.0' TEST_KAFKA='true' ts-scripts test --suite e2e --",
"test:watch": "TEST_ELASTICSEARCH='true' TEST_KAFKA='true' ts-scripts test --suite e2e --watch --"
Expand Down
1 change: 0 additions & 1 deletion e2e/test/global.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const {
} = require('./config');

module.exports = async () => {
signale.debug('@@@@ HOST_IP: ', HOST_IP);
const teraslice = new TerasliceHarness();
await teraslice.init();

Expand Down
2 changes: 1 addition & 1 deletion e2e/test/global.teardown.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function globalTeardown(testClient) {
const errors = [];

try {
if (TEST_PLATFORM === 'kubernetes' && !process.env.KEEP_OPEN) {
if (TEST_PLATFORM === 'kubernetes') {
await deleteTerasliceNamespace();
await cleanupIndex(client, 'ts-dev1_*');
} else {
Expand Down
54 changes: 4 additions & 50 deletions e2e/test/teraslice-harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const {
cloneDeep, isEmpty, castArray
} = require('@terascope/utils');
const {
deployK8sTeraslice, showState, showTSMasterLogs,
showTSExLogs, showTSWorkerLogs, describeWorker, getPodYamls, describeNode
deployK8sTeraslice, showState
} = require('@terascope/scripts');
const { createClient, ElasticsearchTestHelpers } = require('elasticsearch-store');
const { TerasliceClient } = require('teraslice-client-js');
Expand Down Expand Up @@ -60,39 +59,15 @@ module.exports = class TerasliceHarness {
const start = Date.now();

try {
if (process.env.TEST_PLATFORM === 'kubernetes') {
signale.debug('@@@ before ex.waitForExStatus');
signale.debug(await showState(HOST_IP));
signale.debug(await describeWorker());
signale.debug(await describeNode());
signale.debug(await getPodYamls());
}
const result = await ex.waitForStatus(status, interval, 2 * 60 * 1000);
if (endDelay) {
// since most of the time we are chaining this with other actions
// make sure we avoid unrealistic test conditions by giving the
// it a little bit of time
await pDelay(endDelay);
}
if (process.env.TEST_PLATFORM === 'kubernetes') {
signale.debug('@@@ after ex.waitForExStatus');
signale.debug(await showState(HOST_IP));
signale.debug(await describeWorker());
signale.debug(await describeNode());
signale.debug(await getPodYamls());
}
return result;
} catch (err) {
if (process.env.TEST_PLATFORM === 'kubernetes') {
signale.debug('@@@ in catch of waitForExStatus');
signale.debug(await describeWorker());
signale.debug(await describeNode());
signale.debug(await getPodYamls());
signale.debug(await showState(HOST_IP));
signale.debug(await showTSMasterLogs());
signale.debug(await showTSExLogs());
signale.debug(await showTSWorkerLogs());
}
err.message = `Execution: ${ex.id()}: ${err.message}`;

this.warn(err.stack, {
Expand All @@ -116,20 +91,18 @@ module.exports = class TerasliceHarness {

if (TEST_PLATFORM === 'kubernetes') {
try {
// console.log('@@@@ before state reset');
// await showState(HOST_IP);
await cleanupIndex(this.client, `${SPEC_INDEX_PREFIX}*`);
await this.clearNonBaseAssets();
} catch (err) {
signale.error('Failure to clean indices', err);
signale.error('Failure to clean indices and assets', err);
throw err;
}
try {
await deployK8sTeraslice();
await pDelay(2000);
await this.waitForTeraslice();
await pDelay(2000);
// console.log('@@@@ after state reset');
await showState(HOST_IP);
} catch (err) {
signale.error('Failure to reset teraslice state', err);
Expand Down Expand Up @@ -459,13 +432,7 @@ module.exports = class TerasliceHarness {
}

async postJob(jobSpec) {
const result = this.teraslice.executions.submit(jobSpec);
signale.debug('@@@ postJob result: ', result);
if (process.env.TEST_PLATFORM === 'kubernetes') {
signale.debug('@@@ after postJob result');
signale.debug(await showState(HOST_IP));
}
return result;
return this.teraslice.executions.submit(jobSpec);
}

async generate(count, hex) {
Expand Down Expand Up @@ -514,15 +481,7 @@ module.exports = class TerasliceHarness {
await Promise.all(executions.map((ex) => this.waitForExStatus(ex, 'completed')));
} else {
const ex = await this.postJob(jobSpec);
if (process.env.TEST_PLATFORM === 'kubernetes') {
signale.debug('@@@ after postJob');
signale.debug(await showState(HOST_IP));
}
await this.waitForExStatus(ex, 'completed');
if (process.env.TEST_PLATFORM === 'kubernetes') {
signale.debug('@@@ after waitForExStatus');
signale.debug(await showState(HOST_IP));
}
}

signale.info(`Generated ${indexName} example data`, getElapsed(genStartTime));
Expand Down Expand Up @@ -556,17 +515,12 @@ module.exports = class TerasliceHarness {

async clearNonBaseAssets() {
const assetList = await this.teraslice.assets.list();
// console.log('@@@@@ assetList: ', assetList);

const baseAssets = ['standard', 'elasticsearch', 'kafka'];
const assetsToDelete = assetList.filter((assetObj) => !baseAssets.includes(assetObj.name));
// console.log('@@@@@ assetsToDelete: ', assetsToDelete);

for (const asset of assetsToDelete) {
// console.log('@@@@@ asset: ', asset);
const response = await this.teraslice.assets.remove(asset.id);
// console.log('@@@@@ response: ', response);
signale.success(`Deleted asset with id ${response}`);
signale.debug(`Deleted asset with id ${response._id}`);
}
}
};
Loading

0 comments on commit 8ce6270

Please sign in to comment.