Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

test: Add e2e test #618

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: E2E
on:
push:
branches:
- "test/e2e"
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
contents: read
strategy:
matrix:
suite: [data-lake, synchronous, emr-eks]
fail-fast: false
env:
CI: "true"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup Node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Setup Java 11
uses: actions/setup-java@v2
with:
distribution: 'zulu' # OpenJDK
java-version: '11'
- name: Install dependencies
run: cd core && yarn install --check-files --frozen-lockfile
- name: Set git identity
run: |-
git config user.name "Automation"
git config user.email "[email protected]"
- name: Build
run: cd core && npx projen build
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
aws-region: us-east-1
- name: E2E
run: cd core && npx jest --group=integ/${{ matrix.suite }}
container:
image: jsii/superchain:1-buster-slim-node14
1 change: 1 addition & 0 deletions core/src/notebook-platform/notebook-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ export class NotebookPlatform extends TrackedConstruct {

new CfnOutput(this, `URL for EMR Studio: ${this.studioName}`, {
value: this.studioInstance.attrUrl,
exportName: `{this.studioName}`
});

/*//Return EMR Studio URL as CfnOutput
Expand Down
53 changes: 53 additions & 0 deletions core/test/e2e/emr-eks-notebook-platform.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0

/**
* Tests EmrEksCluster
*
* @group integ/emr-eks/notebook-platform
*/

import * as cdk from 'aws-cdk-lib';
import { deployStack, destroyStack } from './utils';

import { Autoscaler, EmrEksCluster } from '../../src/emr-eks-platform';
import { NotebookPlatform, StudioAuthMode } from '../../src/notebook-platform';

jest.setTimeout(2000000);
// GIVEN
const integTestApp = new cdk.App();
const stack = new cdk.Stack(integTestApp, 'EmrEksClustereE2eTest');

const emrEksCluster = EmrEksCluster.getOrCreate(stack, {
eksAdminRoleArn: 'arn:aws:iam::123445678912:role/my-role',
autoscaling: Autoscaler.CLUSTER_AUTOSCALER,
});

new NotebookPlatform(stack, 'dataplatformIAMAuth', {
emrEks: emrEksCluster,
studioName: 'e2estudio',
studioAuthMode: StudioAuthMode.IAM,
eksNamespace: 'dataplatformiamauth',
});

new cdk.CfnOutput(stack, 'EmrEksAdminRoleOutput', {
value: emrEksCluster.eksCluster.adminRole.roleArn,
exportName: 'emrEksAdminRole',
});

describe('deploy succeed', () => {
it('can be deploy succcessfully', async () => {
// GIVEN
const deployResult = await deployStack(integTestApp, stack);

// THEN
expect(deployResult.outputs.emrEksAdminRole).toEqual('arn:aws:iam::123445678912:role/my-role');

expect(deployResult.outputs.e2estudio).toMatch(/^https:\/\/.*/);

}, 9000000);
});

afterAll(async () => {
await destroyStack(integTestApp, stack);
}, 9000000);
2 changes: 1 addition & 1 deletion core/test/e2e/emr-eks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Tests EmrEksCluster
*
* @group integ/emr-eks-cluster
* @group integ/emr-eks/cluster
*/

import * as cdk from 'aws-cdk-lib';
Expand Down
2 changes: 1 addition & 1 deletion core/test/e2e/synchronous-athena-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Tests SynchronousAthenaQuery
*
* @group integ/synchronous-athena-query
* @group integ/synchronous/synchronous-athena-query
*/

import { PolicyStatement } from 'aws-cdk-lib/aws-iam';
Expand Down
2 changes: 1 addition & 1 deletion core/test/e2e/synchronous-crawler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Tests SyncrhonousCrawler
*
* @group integ/synchronous-crawler
* @group integ/synchronous/synchronous-crawler
*/

import * as cdk from 'aws-cdk-lib';
Expand Down
2 changes: 1 addition & 1 deletion core/test/e2e/synchronous-glue-job.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Tests SynchronousGlueJob
*
* @group integ/synchronous-glue-job
* @group integ/synchronous/synchronous-glue-job
*/

import * as cdk from 'aws-cdk-lib';
Expand Down