Skip to content

Commit

Permalink
Fix prettier issue
Browse files Browse the repository at this point in the history
  • Loading branch information
LAKSHMIRPILLAI committed Sep 29, 2023
1 parent 8f88be9 commit e43095e
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 101 deletions.
2 changes: 1 addition & 1 deletion support-lambdas/support-post-deployment-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "example-typecript-lambda",
"name": "support-frontend-post-deployments-tests-lambda",
"version": "1.0.0",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import 'source-map-support/register';
import { GuRootExperimental } from '@guardian/cdk/lib/experimental/constructs';
import { LoggingLevel,SupportFrontendPostDeploymentTestsLambda } from '../lib/support-frontend-post-deployment-tests-lambda';
import {
LoggingLevel,
SupportFrontendPostDeploymentTestsLambda,
} from '../lib/support-frontend-post-deployment-tests-lambda';

/**
* GuRootExperimental will generate a `riff-raff.yaml` configuration file to deploy this project with Riff-Raff.
Expand All @@ -9,50 +12,58 @@ import { LoggingLevel,SupportFrontendPostDeploymentTestsLambda } from '../lib/su
*/
const app = new GuRootExperimental();

new SupportFrontendPostDeploymentTestsLambda(app, 'SupportFrontendPostDeploymentTestsLambda-CODE', {
/**
* This becomes the value of the STACK tag on provisioned resources.
*
* It is also used by Riff-Raff to determine the AWS account to deploy into.
*
* @see https://riffraff.gutools.co.uk/deployinfo/data?key=credentials%3Aaws-cfn-role
*/
stack: 'membership',

/**
* This becomes the value of the STAGE tag on provisioned resources.
*/
stage: 'CODE',

env: {
new SupportFrontendPostDeploymentTestsLambda(
app,
'SupportFrontendPostDeploymentTestsLambda-CODE',
{
/**
* Which AWS region should this service be deployed into?
* This becomes the value of the STACK tag on provisioned resources.
*
* It is also used by Riff-Raff to determine the AWS account to deploy into.
*
* @see https://riffraff.gutools.co.uk/deployinfo/data?key=credentials%3Aaws-cfn-role
*/
region: 'eu-west-1',
},
stack: 'membership',

},LoggingLevel.DEBUG);
/**
* This becomes the value of the STAGE tag on provisioned resources.
*/
stage: 'CODE',

new SupportFrontendPostDeploymentTestsLambda(app, 'SupportFrontendPostDeploymentTestsLambda-PROD', {
/**
* This becomes the value of the STACK tag on provisioned resources.
*
* It is also used by Riff-Raff to determine the AWS account to deploy into.
*
* @see https://riffraff.gutools.co.uk/deployinfo/data?key=credentials%3Aaws-cfn-role
*/
stack: 'membership',
env: {
/**
* Which AWS region should this service be deployed into?
*/
region: 'eu-west-1',
},
},
LoggingLevel.DEBUG,
);

/**
* This becomes the value of the STAGE tag on provisioned resources.
*/
stage: 'PROD',
new SupportFrontendPostDeploymentTestsLambda(
app,
'SupportFrontendPostDeploymentTestsLambda-PROD',
{
/**
* This becomes the value of the STACK tag on provisioned resources.
*
* It is also used by Riff-Raff to determine the AWS account to deploy into.
*
* @see https://riffraff.gutools.co.uk/deployinfo/data?key=credentials%3Aaws-cfn-role
*/
stack: 'membership',

env: {
/**
* Which AWS region should this service be deployed into?
*/
region: 'eu-west-1',
},
},LoggingLevel.INFO);
/**
* This becomes the value of the STAGE tag on provisioned resources.
*/
stage: 'PROD',

env: {
/**
* Which AWS region should this service be deployed into?
*/
region: 'eu-west-1',
},
},
LoggingLevel.INFO,
);
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,32 @@ import { SupportFrontendPostDeploymentTestsLambda } from './support-frontend-pos
describe('The SupportFrontendPostDeploymentTestsLambda stack', () => {
it('matches the snapshot', () => {
const app = new App();
const codeStack = new SupportFrontendPostDeploymentTestsLambda(app, "SupportFrontendPostDeploymentTestsLambda-CODE", {
stack: "support",
stage: "CODE",
env: {
region: 'eu-west-1',
const codeStack = new SupportFrontendPostDeploymentTestsLambda(
app,
'SupportFrontendPostDeploymentTestsLambda-CODE',
{
stack: 'support',
stage: 'CODE',
env: {
region: 'eu-west-1',
},
},
});
const prodStack = new SupportFrontendPostDeploymentTestsLambda(app, "SupportFrontendPostDeploymentTestsLambda-PROD", {
stack: "support",
stage: "PROD",
env: {
region: 'eu-west-1',
);
const prodStack = new SupportFrontendPostDeploymentTestsLambda(
app,
'SupportFrontendPostDeploymentTestsLambda-PROD',
{
stack: 'support',
stage: 'PROD',
env: {
region: 'eu-west-1',
},
},
});
);

expect(Template.fromStack(codeStack).toJSON()).toMatchSnapshot();
expect(Template.fromStack(prodStack).toJSON()).toMatchSnapshot();


/**
* Snapshot testing helps to understand exactly what impact a CDK change will have on the provisioned infrastructure.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,42 @@ import { Runtime } from 'aws-cdk-lib/aws-lambda';
const APP_NAME = 'support-frontend-post-deployment-tests-lambda';

export enum LoggingLevel {
SILLY,
TRACE,
DEBUG,
INFO,
WARN,
ERROR,
FATAL,
SILLY,
TRACE,
DEBUG,
INFO,
WARN,
ERROR,
FATAL,
}

export class SupportFrontendPostDeploymentTestsLambda extends GuStack {
constructor(
scope: App,
id: string,
props: GuStackProps,
loggingLevel: number = LoggingLevel.WARN,
) {
super(scope, id, props);
constructor(
scope: App,
id: string,
props: GuStackProps,
loggingLevel: number = LoggingLevel.WARN,

Check warning on line 28 in support-lambdas/support-post-deployment-tests/packages/cdk/lib/support-frontend-post-deployment-tests-lambda.ts

View workflow job for this annotation

GitHub Actions / CI

'loggingLevel' is assigned a value but never used
) {
super(scope, id, props);

const otherConfig = {
app: APP_NAME,
runtime: Runtime.NODEJS_18_X,
fileName: `${APP_NAME}.zip`,
timeout: Duration.millis(45000),
};
const otherConfig = {
app: APP_NAME,
runtime: Runtime.NODEJS_18_X,
fileName: `${APP_NAME}.zip`,
timeout: Duration.millis(45000),
};

new GuScheduledLambda(this, APP_NAME, {
handler: 'dist/lambda/index.handler',
rules: [
{
schedule: Schedule.cron({ hour: '10', minute: '00', weekDay: '2' }),
},
],
monitoringConfiguration: {
noMonitoring: true,
},
...otherConfig,
});
}
new GuScheduledLambda(this, APP_NAME, {
handler: 'dist/lambda/index.handler',
rules: [
{
schedule: Schedule.cron({ hour: '10', minute: '00', weekDay: '2' }),
},
],
monitoringConfiguration: {
noMonitoring: true,
},
...otherConfig,
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ const { bsLocal } = require('./browserstack.config');
const { promisify } = require('util');
const sleep = promisify(setTimeout);
module.exports = async () => {
// Stop the Local instance after your test run is completed, i.e after driver.quit
let localStopped = false;
// Stop the Local instance after your test run is completed, i.e after driver.quit
let localStopped = false;

if (bsLocal && bsLocal.isRunning()) {
bsLocal.stop(() => {
localStopped = true;
console.log('Stopped BrowserStackLocal');
});
while (!localStopped) {
await sleep(1000);
}
}
}
if (bsLocal && bsLocal.isRunning()) {
bsLocal.stop(() => {
localStopped = true;
console.log('Stopped BrowserStackLocal');
});
while (!localStopped) {
await sleep(1000);
}
}
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { devices } from '@playwright/test';
import type { PlaywrightTestConfig } from '@playwright/test';

export const baseObject:PlaywrightTestConfig = {
export const baseObject: PlaywrightTestConfig = {
testDir: './tests',
testMatch: '**/*.ts',

Expand Down

0 comments on commit e43095e

Please sign in to comment.