Skip to content

Commit

Permalink
fix: Updates to RStudio Integration tests (awslabs#818)
Browse files Browse the repository at this point in the history
* chore: Remove extraneous comments from launch-rstudio-workspace.test.js

* fix: Don't run rstudio tests if rstudio config is 'N/A'

* Move advanced tests into common folder so they get executed

* Fix import path

Co-authored-by: Tim Nguyen <thingut@amazon.com>
  • Loading branch information
nguyen102 and Tim Nguyen authored Nov 19, 2021
1 parent d7268b1 commit c167352
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

const { sleep } = require('@aws-ee/base-services/lib/helpers/utils');
const axios = require('axios').default;
const { runSetup } = require('../../../support/setup');
const { deleteWorkspaceServiceCatalog } = require('../../../support/complex/delete-workspace-service-catalog');
const { runSetup } = require('../../../../../support/setup');
const { deleteWorkspaceServiceCatalog } = require('../../../../../support/complex/delete-workspace-service-catalog');

describe('Launch and terminate RStudio instance', () => {
let setup;
Expand All @@ -28,7 +28,7 @@ describe('Launch and terminate RStudio instance', () => {
});

afterAll(async () => {
// await setup.cleanup();
await setup.cleanup();
});

async function checkAllRstudioWorkspaceIsTerminated() {
Expand All @@ -46,12 +46,14 @@ describe('Launch and terminate RStudio instance', () => {

// eslint-disable-next-line jest/expect-expect
it('should launch a RStudio instance', async () => {
if (setup.defaults.envTypes.rstudio.envTypeId === 'N/A') {
return;
}
// Putting checkAllRstudioWorkspaceIsTerminated check here, because putting this check in `beforeAll` will not stop executing the test if the check does fail
// https://github.com/facebook/jest/issues/2713
await checkAllRstudioWorkspaceIsTerminated();

const envId = await launchRStudioWorkspace();
// const envId = 'f7cb0f78-3fd2-4351-bea0-b6a05096c2c5';

// For installations without AppStream enabled, check that workspace CIDR can be changed
if (!setup.defaults.isAppStreamEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/
const { sleep } = require('@aws-ee/base-services/lib/helpers/utils');
const { NodeSSH } = require('node-ssh');
const { mountStudies, readWrite } = require('../../../support/complex/run-shell-command');
const { runSetup } = require('../../../support/setup');
const { mountStudies, readWrite } = require('../../../../../support/complex/run-shell-command');
const { runSetup } = require('../../../../../support/setup');

describe('EC2 Linux scenarios', () => {
let setup;
Expand Down

0 comments on commit c167352

Please sign in to comment.