Skip to content

Commit

Permalink
Run DevWorkspace Happy path tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dmytro Nochevnov <[email protected]>
  • Loading branch information
dmytro-ndp committed Feb 1, 2022
1 parent f1e1d05 commit b44140b
Show file tree
Hide file tree
Showing 10 changed files with 7,026 additions and 6,676 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"fs-extra": "^9.0.1",
"inversify": "^5.0.5",
"js-yaml": "^4.0.0",
"reflect-metadata": "^0.1.13"
"reflect-metadata": "^0.1.13",
"yarn": "^1.22.17"
},
"devDependencies": {
"@types/fs-extra": "^9.0.6",
Expand All @@ -24,7 +25,7 @@
"@typescript-eslint/eslint-plugin": "^4.13.0",
"@typescript-eslint/parser": "^4.13.0",
"@vercel/ncc": "^0.27.0",
"concurrently": "^5.3.0",
"concurrently": "^7.0.0",
"cpx": "^1.5.0",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
Expand All @@ -33,9 +34,9 @@
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-no-null": "^1.0.2",
"if-env": "^1.0.4",
"import-sort-style-eslint": "^6.0.0",
"import-sort-style-eslint": "^4.2.0",
"jest": "^26.6.3",
"nexe": "3.3.7",
"nexe": "^1.1.6",
"prettier": "^2.2.1",
"prettier-plugin-import-sort": "^0.0.6",
"ts-jest": "^26.4.4",
Expand Down
11 changes: 9 additions & 2 deletions src/happy-path-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export class HappyPathHelper {

async start(): Promise<void> {
const cheUrl = this.configuration.cheUrl();

const HAPPY_PATH_TEST_PROJECT = "https://github.com/che-samples/java-spring-petclinic/tree/devfilev2"

core.info(`Happy path tests will use Eclipse Che URL: ${cheUrl}`);

const e2eFolder = path.resolve('che', 'tests', 'e2e');
Expand Down Expand Up @@ -50,14 +53,18 @@ export class HappyPathHelper {
'-e',
'TS_SELENIUM_MULTIUSER=true',
'-e',
'TS_SELENIUM_USERNAME=admin',
'TS_SELENIUM_USERNAME=[email protected]',
'-e',
'TS_SELENIUM_PASSWORD=admin',
'-e',
'NODE_TLS_REJECT_UNAUTHORIZED=0',
'-e',
`TS_SELENIUM_DEVWORKSPACE_URL=${cheUrl}/#${HAPPY_PATH_TEST_PROJECT}`,
'-e',
'TEST_SUITE=test-devworkspace-happy-path',
'-v',
`${e2eFolder}:/tmp/e2e`,
'quay.io/eclipse/che-e2e:nightly',
'quay.io/eclipse/che-e2e:next',
];

core.info('Launch docker command' + params);
Expand Down
2 changes: 0 additions & 2 deletions src/inversify-binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { HappyPathHelper } from './happy-path-helper';
import { ImagesHelper } from './images-helper';
import { K8sHelper } from './k8s-helper';
import { LaunchHappyPath } from './launch-happy-path';
import { WorkspaceHelper } from './workspace-helper';

export class InversifyBinding {
private container: Container;
Expand All @@ -30,7 +29,6 @@ export class InversifyBinding {
this.container.bind(HappyPathHelper).toSelf().inSingletonScope();
this.container.bind(ImagesHelper).toSelf().inSingletonScope();
this.container.bind(K8sHelper).toSelf().inSingletonScope();
this.container.bind(WorkspaceHelper).toSelf().inSingletonScope();

this.container.bind(Configuration).toConstantValue(this.configuration);
this.container.bind(LaunchHappyPath).toSelf().inSingletonScope();
Expand Down
7 changes: 0 additions & 7 deletions src/launch-happy-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { inject, injectable } from 'inversify';
import { CheHelper } from './che-helper';
import { HappyPathHelper } from './happy-path-helper';
import { ImagesHelper } from './images-helper';
import { WorkspaceHelper } from './workspace-helper';

@injectable()
export class LaunchHappyPath {
Expand All @@ -24,9 +23,6 @@ export class LaunchHappyPath {
@inject(CheHelper)
private cheHelper: CheHelper;

@inject(WorkspaceHelper)
private workspaceHelper: WorkspaceHelper;

@inject(HappyPathHelper)
private happyPathHelper: HappyPathHelper;

Expand All @@ -37,9 +33,6 @@ export class LaunchHappyPath {
core.info('Images [pull]...');
await this.imagesHelper.pull();

core.info('Workspace [start]...');
await this.workspaceHelper.start();

core.info('Happy Path [start]...');
await this.happyPathHelper.start();
}
Expand Down
67 changes: 0 additions & 67 deletions src/workspace-helper.ts

This file was deleted.

2 changes: 0 additions & 2 deletions tests/inversify-binding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { ImagesHelper } from '../src/images-helper';
import { InversifyBinding } from '../src/inversify-binding';
import { K8sHelper } from '../src/k8s-helper';
import { LaunchHappyPath } from '../src/launch-happy-path';
import { WorkspaceHelper } from '../src/workspace-helper';

/* eslint-disable @typescript-eslint/no-explicit-any */

Expand All @@ -35,7 +34,6 @@ describe('Test InversifyBinding', () => {
expect(container.isBound(HappyPathHelper)).toBeTruthy();
expect(container.isBound(ImagesHelper)).toBeTruthy();
expect(container.isBound(K8sHelper)).toBeTruthy();
expect(container.isBound(WorkspaceHelper)).toBeTruthy();

// config
const configuration: Configuration = container.get(Configuration);
Expand Down
9 changes: 0 additions & 9 deletions tests/launch-happy-path.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Container } from 'inversify';
import { HappyPathHelper } from '../src/happy-path-helper';
import { ImagesHelper } from '../src/images-helper';
import { LaunchHappyPath } from '../src/launch-happy-path';
import { WorkspaceHelper } from '../src/workspace-helper';

/* eslint-disable @typescript-eslint/no-explicit-any */

Expand All @@ -24,7 +23,6 @@ describe('Test LaunchHappyPath', () => {
let configuration: Configuration;
let cheHelper: CheHelper;
let imagesHelper: ImagesHelper;
let workspaceHelper: WorkspaceHelper;
let happyPathHelper: HappyPathHelper;

beforeEach(() => {
Expand All @@ -41,11 +39,6 @@ describe('Test LaunchHappyPath', () => {
} as any;
container.bind(ImagesHelper).toConstantValue(imagesHelper);

workspaceHelper = {
start: jest.fn(),
} as any;
container.bind(WorkspaceHelper).toConstantValue(workspaceHelper);

happyPathHelper = {
start: jest.fn(),
} as any;
Expand All @@ -68,8 +61,6 @@ describe('Test LaunchHappyPath', () => {

expect(imagesHelper.pull).toBeCalled();

expect(workspaceHelper.start).toBeCalled();

expect(happyPathHelper.start).toBeCalled();
});
});
Loading

0 comments on commit b44140b

Please sign in to comment.