Skip to content

Commit

Permalink
feat: Pull AppStream create connection test env id from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Nguyen committed Sep 21, 2021
1 parent e937d8b commit d002f64
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-integ-appstream-egress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
integration-test:
name: Integration test
runs-on: ubuntu-18.04
needs: deploy
needs: infrastructure-test
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('Create URL scenarios', () => {
describe('Create AppStream URL', () => {
it('should return AppStream URL: SageMaker', async () => {
// BUILD
const envId = '36f22de5-fefb-4f62-8ab4-e99ac4387ad4';
const envId = setup.defaults.sagemakerEnvId;
const connectionId = 'id-0';
const applicationName = 'Firefox';
const sagemakerUrlPrefix = 'https://basicnotebookinstance';
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('Create URL scenarios', () => {
[
'Windows',
{
envId: '5360d995-fa4b-44eb-b67d-a0586886e1a3',
envIdPath: 'windowsEnvId',
connectionId: 'id-1',
applicationName: 'MicrosoftRemoteDesktop',
preAuthStreamingUrl: 'https://appstream2.us-east-1.aws.amazon.com/authenticate?parameters=',
Expand All @@ -95,7 +95,7 @@ describe('Create URL scenarios', () => {
[
'EC2 Linux',
{
envId: '4ceb23c8-c80c-4ded-b948-c63b21ba5c72',
envIdPath: 'linuxEnvId',
connectionId: 'id-1',
applicationName: 'EC2Linux',
preAuthStreamingUrl: 'https://appstream2.us-east-1.aws.amazon.com/authenticate?parameters=',
Expand All @@ -109,7 +109,7 @@ describe('Create URL scenarios', () => {
it.each(testContexts)('should return AppStream URL: %s', async (_, testContext) => {
// OPERATE
const connectionUrlResponse = await adminSession.resources.workspaceServiceCatalogs
.workspaceServiceCatalog(testContext.envId)
.workspaceServiceCatalog(setup.defaults[testContext.envIdPath])
.connections()
.connection(testContext.connectionId)
.createUrl();
Expand Down
24 changes: 17 additions & 7 deletions main/integration-tests/config/settings/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,29 @@ localApiEndpoint: http://localhost:4000
# ec2LinuxConfigId: ""

# Provide the id of the available EC2-Windows Service Catalog product
# ec2WindowsEnvTypeId: "prod-sampleEC2Windows-pa-sampleEC2Windows"
#ec2WindowsEnvTypeId: "prod-sampleEC2Windows-pa-sampleEC2Windows"
# Provide the id of a configuration for an imported EC2-Windows environment
# ec2WindowsConfigId: ""
#ec2WindowsConfigId: ""

# Provide the id of the available SageMaker Service Catalog product
# sagemakerEnvTypeId: "prod-sampleSageMaker-pa-sampleSageMaker"
#sagemakerEnvTypeId: "prod-sampleSageMaker-pa-sampleSageMaker"
# Provide the id of a configuration for an imported SageMaker environment
# sagemakerConfigId: ""
#sagemakerConfigId: ""

# Provide the id of the available EMR Service Catalog product
# emrEnvTypeId: "prod-sampleEMR-pa-sampleEMR"
#emrEnvTypeId: "prod-sampleEMR-pa-sampleEMR"
# Provide the id of a configuration for an imported EMR environment
# emrConfigId: ""
#emrConfigId: ""

# Provide the id of the external BYOB Data Source study
# byobStudy: ""
#byobStudy: ""

# ------- CONFIG VALUES BELOW ONLY REQUIRED FOR TESTS IN "appstream-egress-enabled" FOLDER ------
# Provide the id of a Sagemaker workspace actively running in SWB
#sagemakerEnvId: ""

# Provide the id of a Linux workspace actively running in SWB
#linuxEnvId: ""

# Provide the id of a Windows workspace actively running in SWB
#windowsEnvId: ""
9 changes: 9 additions & 0 deletions main/integration-tests/support/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,18 @@ class Setup {
workflowTemplateId,
envTypes,
byobStudy,
...(await this.getConfigForAppStreamEnabledTests()),
};
}

async getConfigForAppStreamEnabledTests() {
const sagemakerEnvId = await this.settings.optional('sagemakerEnvId', '');
const linuxEnvId = await this.settings.optional('linuxEnvId', '');
const windowsEnvId = await this.settings.optional('windowsEnvId');

return { sagemakerEnvId, linuxEnvId, windowsEnvId };
}

async createAdminSession() {
const adminSession = await this.defaultAdminSession();
const username = this.gen.username({ prefix: 'test-admin' });
Expand Down

0 comments on commit d002f64

Please sign in to comment.