Skip to content

Commit

Permalink
test: Refactor confirmCloudWatchLogs to rely on awsRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Dec 20, 2019
1 parent 4b171f5 commit 4737c2e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/utils/misc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const _ = require('lodash');
const BbPromise = require('bluebird');
const AWS = require('aws-sdk');
const CloudWatchLogsSdk = require('aws-sdk/clients/cloudwatchlogs');
const awsLog = require('log').get('aws');

const logger = console;
Expand Down Expand Up @@ -42,8 +41,6 @@ function awsRequest(service, method, ...args) {
);
}

const cloudWatchLogsSdk = new CloudWatchLogsSdk({ region });

const testServiceIdentifier = 'integ-test';

const serviceNameRegex = new RegExp(`${testServiceIdentifier}-d+`);
Expand Down Expand Up @@ -78,7 +75,7 @@ function replaceEnv(values) {
function confirmCloudWatchLogs(logGroupName, trigger, timeout = 60000) {
const startTime = Date.now();
return trigger()
.then(() => cloudWatchLogsSdk.filterLogEvents({ logGroupName }).promise())
.then(() => awsRequest('CloudWatchLogs', 'filterLogEvents', { logGroupName }))
.then(result => {
if (result.events.length) return result.events;
const duration = Date.now() - startTime;
Expand Down

0 comments on commit 4737c2e

Please sign in to comment.