Skip to content
Merged
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
6 changes: 6 additions & 0 deletions frontend/integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@console/internal-integration-tests",
"version": "0.0.0-fixed",
"description": "Console integration tests to be moved into appropriate packages",
"private": true
}
190 changes: 96 additions & 94 deletions frontend/integration-tests/protractor.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import * as ConsoleReporter from 'jasmine-console-reporter';
import * as failFast from 'protractor-fail-fast';
import { createWriteStream, writeFileSync } from 'fs';
import { format } from 'util';
import {
resolvePluginPackages,
reducePluginTestSuites,
mergeTestSuites,
} from '@console/plugin-sdk/src/codegen';

const tap = !!process.env.TAP;

Expand All @@ -32,12 +37,98 @@ const junitReporter = new JUnitXmlReporter({
});
const browserLogs: logging.Entry[] = [];

const suite = (tests: string[]) =>
const suite = (tests: string[]): string[] =>
(!_.isNil(process.env.BRIDGE_KUBEADMIN_PASSWORD) ? ['tests/login.scenario.ts'] : []).concat([
'tests/base.scenario.ts',
...tests,
]);

// TODO(vojtech): move base Console test suites to console-app package
const testSuites = {
filter: suite(['tests/filter.scenario.ts']),
annotation: suite(['tests/modal-annotations.scenario.ts']),
environment: suite(['tests/environment.scenario.ts']),
secrets: suite(['tests/secrets.scenario.ts']),
storage: suite(['tests/storage.scenario.ts']),
crud: suite([
'tests/crud.scenario.ts',
'tests/secrets.scenario.ts',
'tests/filter.scenario.ts',
'tests/modal-annotations.scenario.ts',
'tests/environment.scenario.ts',
]),
monitoring: suite(['tests/monitoring.scenario.ts']),
newApp: suite(['tests/overview/overview.scenario.ts', 'tests/deploy-image.scenario.ts']),
olmFull: suite([
'../packages/operator-lifecycle-manager/integration-tests/scenarios/descriptors.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/operator-hub.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/global-installmode.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/single-installmode.scenario.ts',
]),
performance: suite(['tests/performance.scenario.ts']),
serviceCatalog: suite([
'tests/service-catalog/service-catalog.scenario.ts',
'tests/service-catalog/service-broker.scenario.ts',
'tests/service-catalog/service-class.scenario.ts',
'tests/service-catalog/service-binding.scenario.ts',
'tests/developer-catalog.scenario.ts',
]),
overview: suite(['tests/overview/overview.scenario.ts']),
crdExtensions: suite(['tests/crd-extensions.scenario.ts']),
e2e: suite([
'tests/crud.scenario.ts',
'tests/secrets.scenario.ts',
'tests/storage.scenario.ts',
'tests/filter.scenario.ts',
'tests/modal-annotations.scenario.ts',
'tests/environment.scenario.ts',
'tests/overview/overview.scenario.ts',
'tests/deploy-image.scenario.ts',
'tests/performance.scenario.ts',
'tests/monitoring.scenario.ts',
'tests/crd-extensions.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/descriptors.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/operator-hub.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/global-installmode.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/single-installmode.scenario.ts',
]),
release: suite([
'tests/crud.scenario.ts',
'tests/secrets.scenario.ts',
'tests/filter.scenario.ts',
'tests/environment.scenario.ts',
'tests/overview/overview.scenario.ts',
'tests/deploy-image.scenario.ts',
'tests/performance.scenario.ts',
'tests/monitoring.scenario.ts',
'tests/crd-extensions.scenario.ts',
]),
all: suite([
'tests/crud.scenario.ts',
'tests/overview/overview.scenario.ts',
'tests/secrets.scenario.ts',
'tests/storage.scenario.ts',
'tests/olm/**/*.scenario.ts',
'tests/service-catalog/**/*.scenario.ts',
'tests/filter.scenario.ts',
'tests/modal-annotations.scenario.ts',
'tests/deploy-image.scenario.ts',
'tests/operator-hub/operator-hub.scenario.ts',
'tests/developer-catalog.scenario.ts',
'tests/monitoring.scenario.ts',
'tests/devconsole/dev-perspective.scenario.ts',
'tests/devconsole/git-import-flow.scenario.ts',
'tests/crd-extensions.scenario.ts',
]),
clusterSettings: suite(['tests/cluster-settings.scenario.ts']),
login: ['tests/login.scenario.ts'],
// TODO(vojtech): move to dev-console package, with suite() mapper applied automatically
devconsole: [
'tests/devconsole/dev-perspective.scenario.ts',
'tests/devconsole/git-import-flow.scenario.ts',
],
};

export const config: Config = {
framework: 'jasmine',
directConnect: true,
Expand Down Expand Up @@ -112,99 +203,10 @@ export const config: Config = {
failFast.clean();
return new Promise((resolve) => htmlReporter.afterLaunch(resolve.bind(this, exitCode)));
},
suites: {
filter: suite(['tests/filter.scenario.ts']),
annotation: suite(['tests/modal-annotations.scenario.ts']),
environment: suite(['tests/environment.scenario.ts']),
secrets: suite(['tests/secrets.scenario.ts']),
storage: suite(['tests/storage.scenario.ts']),
crud: suite([
'tests/crud.scenario.ts',
'tests/secrets.scenario.ts',
'tests/filter.scenario.ts',
'tests/modal-annotations.scenario.ts',
'tests/environment.scenario.ts',
]),
monitoring: suite(['tests/monitoring.scenario.ts']),
newApp: suite(['tests/overview/overview.scenario.ts', 'tests/deploy-image.scenario.ts']),
olmFull: suite([
'../packages/operator-lifecycle-manager/integration-tests/scenarios/descriptors.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/operator-hub.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/global-installmode.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/single-installmode.scenario.ts',
]),
performance: suite(['tests/performance.scenario.ts']),
serviceCatalog: suite([
'tests/service-catalog/service-catalog.scenario.ts',
'tests/service-catalog/service-broker.scenario.ts',
'tests/service-catalog/service-class.scenario.ts',
'tests/service-catalog/service-binding.scenario.ts',
'tests/developer-catalog.scenario.ts',
]),
overview: suite(['tests/overview/overview.scenario.ts']),
crdExtensions: suite(['tests/crd-extensions.scenario.ts']),
e2e: suite([
'tests/crud.scenario.ts',
'tests/secrets.scenario.ts',
'tests/storage.scenario.ts',
'tests/filter.scenario.ts',
'tests/modal-annotations.scenario.ts',
'tests/environment.scenario.ts',
'tests/overview/overview.scenario.ts',
'tests/deploy-image.scenario.ts',
'tests/performance.scenario.ts',
'tests/monitoring.scenario.ts',
'tests/crd-extensions.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/descriptors.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/operator-hub.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/global-installmode.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/single-installmode.scenario.ts',
]),
release: suite([
'tests/crud.scenario.ts',
'tests/secrets.scenario.ts',
'tests/filter.scenario.ts',
'tests/environment.scenario.ts',
'tests/overview/overview.scenario.ts',
'tests/deploy-image.scenario.ts',
'tests/performance.scenario.ts',
'tests/monitoring.scenario.ts',
'tests/crd-extensions.scenario.ts',
]),
'kubevirt-plugin': suite([
'../packages/kubevirt-plugin/integration-tests/tests/vm.wizard.scenario.ts',
'../packages/kubevirt-plugin/integration-tests/tests/vm.yaml.scenario.ts',
'../packages/kubevirt-plugin/integration-tests/tests/vm.actions.scenario.ts',
'../packages/kubevirt-plugin/integration-tests/tests/vm.migration.scenario.ts',
'../packages/kubevirt-plugin/integration-tests/tests/vm.resources.scenario.ts',
'../packages/kubevirt-plugin/integration-tests/tests/vm.clone.scenario.ts',
'../packages/kubevirt-plugin/integration-tests/tests/vm.detail.flavor.scenario.ts',
'../packages/kubevirt-plugin/integration-tests/tests/vm.template.wizard.scenario.ts',
]),
all: suite([
'tests/crud.scenario.ts',
'tests/overview/overview.scenareio.ts',
'tests/secrets.scenario.ts',
'tests/storage.scenario.ts',
'tests/olm/**/*.scenario.ts',
'tests/service-catalog/**/*.scenario.ts',
'tests/filter.scenario.ts',
'tests/modal-annotations.scenario.ts',
'tests/deploy-image.scenario.ts',
'tests/operator-hub/operator-hub.scenario.ts',
'tests/developer-catalog.scenario.ts',
'tests/monitoring.scenario.ts',
'tests/devconsole/dev-perspective.scenario.ts',
'tests/devconsole/git-import-flow.scenario.ts',
'tests/crd-extensions.scenario.ts',
]),
clusterSettings: suite(['tests/cluster-settings.scenario.ts']),
login: ['tests/login.scenario.ts'],
devconsole: [
'tests/devconsole/dev-perspective.scenario.ts',
'tests/devconsole/git-import-flow.scenario.ts',
],
},
suites: mergeTestSuites(
testSuites,
reducePluginTestSuites(resolvePluginPackages(), __dirname, suite),
),
params: {
// Set to 'true' to enable OpenShift resources in the crud scenario.
// Use a string rather than boolean so it can be specified on the command line:
Expand Down
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"private": true,
"workspaces": [
"packages/*",
"public"
"public",
"integration-tests"
],
"scripts": {
"clean": "rm -rf ./public/dist",
Expand Down Expand Up @@ -159,6 +160,7 @@
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "1.12.1",
"file-loader": "1.x",
"find-up": "4.x",
"fork-ts-checker-webpack-plugin": "0.x",
"glob": "7.x",
"glslify-loader": "1.x",
Expand Down
4 changes: 1 addition & 3 deletions frontend/packages/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module.exports = {
root: true,
extends: [
'plugin:console/react-typescript-prettier',
],
extends: ['plugin:console/react-typescript-prettier'],
rules: {
'no-restricted-imports': [
'error',
Expand Down
8 changes: 4 additions & 4 deletions frontend/packages/console-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"@console/git-service": "0.0.0-fixed",
"@console/internal": "0.0.0-fixed",
"@console/knative-plugin": "0.0.0-fixed",
"@console/kubevirt-plugin": "0.0.0-fixed",
"@console/metal3-plugin": "0.0.0-fixed",
"@console/network-attachment-definition-plugin": "0.0.0-fixed",
"@console/noobaa-storage-plugin": "0.0.0-fixed",
"@console/plugin-sdk": "0.0.0-fixed",
"@console/shared": "0.0.0-fixed",
"@console/kubevirt-plugin": "0.0.0-fixed",
"@console/operator-lifecycle-manager": "0.0.0-fixed",
"@console/network-attachment-definition-plugin": "0.0.0-fixed"
"@console/plugin-sdk": "0.0.0-fixed",
"@console/shared": "0.0.0-fixed"
},
"consolePlugin": {
"entry": "src/plugin.tsx"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { browser } from 'protractor';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @yaacov for keeping the demo plugin in mind.

import { appHost, testName } from '@console/internal-integration-tests/protractor.conf';
import * as crudView from '@console/internal-integration-tests/views/crud.view';

describe('Demo integration test', () => {
it(`will load namespace ${testName} details`, async () => {
// Use projects if OpenShift so non-admin users can run tests.
const resource = browser.params.openshift === 'true' ? 'projects' : 'namespaces';
await browser.get(`${appHost}/k8s/cluster/${resource}/${testName}`);
await crudView.isLoaded();

expect(browser.getCurrentUrl()).toContain(appHost);
});
});
5 changes: 4 additions & 1 deletion frontend/packages/console-demo-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"@console/shared": "0.0.0-fixed"
},
"consolePlugin": {
"entry": "src/plugin.tsx"
"entry": "src/plugin.tsx",
"integrationTestSuites": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christianvogt @spadgett Would you prefer this to be shortened to integrationTests ?

This is the plugin metadata from which Protractor suites object {[suiteName: string]: string[]} is created and applied to config.suites in integration-tests/protractor.conf.ts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine with me.

"demo": ["integration-tests/**/*.scenario.ts"]
}
}
}
17 changes: 4 additions & 13 deletions frontend/packages/console-plugin-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,10 @@ The plugin entry module is loaded immediately upon Console startup, so it should
"@console/plugin-sdk": "0.0.0-fixed",
"@console/shared": "0.0.0-fixed"
},
"devDependencies": {
"@console/internal-integration-tests": "0.0.0-fixed"
},
"consolePlugin": {
"entry": "src/plugin.tsx",
"integrationTests": {
"demo": [
"@console/internal-integration-tests/tests/base.scenario.ts",
"integration-tests/tests/demo.scenario.ts"
]
"integrationTestSuites": {

This comment was marked as resolved.

"demo": ["integration-tests/**/*.scenario.ts"]
}
}
}
Expand Down Expand Up @@ -196,11 +190,8 @@ and use common testing methods defined in the internal package by requiring it i
...
"consolePlugin": {
...
"integrationTests": {
"demo": [
"@console/internal-integration-tests/tests/base.scenario.ts",
"integration-tests/tests/demo.scenario.ts"
]
"integrationTestSuites": {
"demo": ["integration-tests/**/*.scenario.ts"]
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions frontend/packages/console-plugin-sdk/src/codegen/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
root: true,
extends: [
'plugin:console/node-typescript-prettier',
],
extends: ['plugin:console/node-typescript-prettier'],
rules: {
'no-underscore-dangle': 'off',
},
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Plugin, HrefNavItem } from '../../typings';
import { loadActivePlugins, getActivePluginsModule } from '../active-plugins';
import { PluginPackage } from '../plugin-resolver';
import { templatePackage } from './plugin-resolver.spec';
import { getTemplatePackage } from './plugin-resolver.spec';

describe('active-plugins', () => {
describe('loadActivePlugins', () => {
Expand Down Expand Up @@ -39,13 +39,15 @@ describe('active-plugins', () => {
expect(
loadActivePlugins([
{
...templatePackage,
name: 'foo',
...getTemplatePackage({
name: 'foo',
}),
consolePlugin: { entry: 'src/plugin.ts' },
},
{
...templatePackage,
name: 'bar-plugin',
...getTemplatePackage({
name: 'bar-plugin',
}),
consolePlugin: { entry: 'index.ts' },
},
]),
Expand All @@ -66,13 +68,15 @@ describe('active-plugins', () => {
it('returns module source that exports the list of active plugins', () => {
const pluginPackages: PluginPackage[] = [
{
...templatePackage,
name: 'foo',
...getTemplatePackage({
name: 'foo',
}),
consolePlugin: { entry: 'src/plugin.ts' },
},
{
...templatePackage,
name: 'bar-plugin',
...getTemplatePackage({
name: 'bar-plugin',
}),
consolePlugin: { entry: 'index.ts' },
},
];
Expand Down
Loading