Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into mergeUpstream_10_…
Browse files Browse the repository at this point in the history
…03_18_10-07-15

Resolved conflict:
- upstream added `dedicated` branding (conflicted with our `okdvirt`)
  • Loading branch information
mareklibra committed Oct 3, 2018
2 parents b3d4f03 + cadee68 commit 7a2980e
Show file tree
Hide file tree
Showing 124 changed files with 2,673 additions and 967 deletions.
3 changes: 2 additions & 1 deletion cmd/bridge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func main() {
fDeveloperConsoleURL := fs.String("developer-console-url", "", "URL for the developer console used in masthead context switcher. This option will be removed in a future release.")

fDexAPIHost := fs.String("dex-api-host", "", "Target host and port of the Dex API service.")
fBranding := fs.String("branding", "okd", "Console branding for the masthead logo and title. One of okd, okdvirt, ocp, or online. Defaults to okd.")
fBranding := fs.String("branding", "okd", "Console branding for the masthead logo and title. One of okd, okdvirt, ocp, online, or dedicated. Defaults to okd.")
fDocumentationBaseURL := fs.String("documentation-base-url", "", "The base URL for documentation links.")
fGoogleTagManagerID := fs.String("google-tag-manager-id", "", "Google Tag Manager ID. External analytics are disabled if this is not set.")

Expand Down Expand Up @@ -152,6 +152,7 @@ func main() {
case "okdvirt":
case "ocp":
case "online":
case "dedicated":
default:
flagFatalf("branding", "value must be one of okd, ocp, or online")
}
Expand Down
8 changes: 4 additions & 4 deletions frontend/__tests__/components/factory/list-page.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import { shallow, ShallowWrapper } from 'enzyme';

import { TextFilter, ListPageWrapper_, FireMan_, MultiListPage } from '../../../public/components/factory/list-page';
import { NavTitle, Dropdown, Firehose } from '../../../public/components/utils';
import { Dropdown, Firehose, PageHeading } from '../../../public/components/utils';
import { CheckBoxes } from '../../../public/components/row-filter';

describe(TextFilter.displayName, () => {
Expand Down Expand Up @@ -38,13 +38,13 @@ describe(FireMan_.displayName, () => {
wrapper = shallow(<FireMan_.WrappedComponent resources={resources} />);
});

it('renders `NavTitle` if given `title`', () => {
expect(wrapper.find(NavTitle).exists()).toBe(false);
it('renders `PageHeading` if given `title`', () => {
expect(wrapper.find(PageHeading).exists()).toBe(false);

const title = 'My pods';
wrapper.setProps({title});

expect(wrapper.find(NavTitle).props().title).toEqual(title);
expect(wrapper.find(PageHeading).props().title).toEqual(title);
});

it('renders create button if given `canCreate` true', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(InstallPlanApprovalModal.name, () => {
it('renders a modal form', () => {
expect(wrapper.find('form').props().name).toEqual('form');
expect(wrapper.find(ModalTitle).exists()).toBe(true);
expect(wrapper.find(ModalSubmitFooter).props().submitText).toEqual('Save Channel');
expect(wrapper.find(ModalSubmitFooter).props().submitText).toEqual('Save');
});

it('renders a radio button for each available approval strategy', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe(SubscriptionChannelModal.name, () => {
it('renders a modal form', () => {
expect(wrapper.find('form').props().name).toEqual('form');
expect(wrapper.find(ModalTitle).exists()).toBe(true);
expect(wrapper.find(ModalSubmitFooter).props().submitText).toEqual('Save Channel');
expect(wrapper.find(ModalSubmitFooter).props().submitText).toEqual('Save');
});

it('renders a radio button for each available channel in the package', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe(ResourceRequirementsModal.name, () => {
expect(wrapper.find('form').exists()).toBe(true);
expect(wrapper.find(modal.ModalTitle).childAt(0).text()).toEqual(title);
expect(wrapper.find(modal.ModalBody).childAt(0).text()).toContain(description);
expect(wrapper.find(modal.ModalSubmitFooter).props().submitText).toEqual('Save Changes');
expect(wrapper.find(modal.ModalSubmitFooter).props().submitText).toEqual('Save');
});

it('calls function to update resource instance when form is submitted', (done) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as React from 'react';
import { Link } from 'react-router-dom';
import { shallow, ShallowWrapper } from 'enzyme';

import { NavTitle, NavTitleProps, BreadCrumbs, BreadCrumbsProps } from '../../../public/components/utils/nav-title';
import { PageHeading, PageHeadingProps, BreadCrumbs, BreadCrumbsProps } from '../../../public/components/utils/headings';
import { ResourceIcon } from '../../../public/components/utils';
import { testResourceInstance } from '../../../__mocks__/k8sResourcesMocks';

Expand Down Expand Up @@ -37,11 +37,11 @@ describe(BreadCrumbs.displayName, () => {
});
});

describe(NavTitle.displayName, () => {
let wrapper: ShallowWrapper<NavTitleProps>;
describe(PageHeading.displayName, () => {
let wrapper: ShallowWrapper<PageHeadingProps>;

beforeEach(() => {
wrapper = shallow(<NavTitle.WrappedComponent obj={null} />);
wrapper = shallow(<PageHeading.WrappedComponent obj={null} />);
});

it('renders resource icon if given `kind`', () => {
Expand Down
17 changes: 14 additions & 3 deletions frontend/integration-tests/protractor.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,28 @@ export const config: Config = {
annotation: ['tests/base.scenario.ts', 'tests/modal-annotations.scenario.ts'],
environment: ['tests/base.scenario.ts', 'tests/environment.scenario.ts'],
crud: ['tests/base.scenario.ts', 'tests/crud.scenario.ts', 'tests/secrets.scenario.ts', 'tests/filter.scenario.ts', 'tests/modal-annotations.scenario.ts', 'tests/environment.scenario.ts'],
s2i: ['tests/base.scenario.ts', 'tests/source-to-image.scenario.ts'],
newApp: ['tests/base.scenario.ts', 'tests/source-to-image.scenario.ts', 'tests/deploy-image.scenario.ts'],
olm: ['tests/base.scenario.ts', 'tests/olm/descriptors.scenario.ts', 'tests/olm/catalog.scenario.ts', 'tests/olm/etcd.scenario.ts', 'tests/olm/prometheus.scenario.ts'],
olmUpgrade: ['tests/base.scenario.ts', 'tests/olm/update-channel-approval.scenario.ts'],
performance: ['tests/base.scenario.ts', 'tests/performance.scenario.ts'],
all: ['tests/base.scenario.ts', 'tests/crud.scenario.ts', 'tests/secrets.scenario.ts', 'tests/olm/**/*.scenario.ts', 'tests/filter.scenario.ts', 'tests/modal-annotations.scenario.ts', 'tests/source-to-image.scenario.ts'],
serviceCatalog: ['tests/base.scenario.ts', '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'],
all: ['tests/base.scenario.ts',
'tests/crud.scenario.ts',
'tests/secrets.scenario.ts',
'tests/olm/**/*.scenario.ts',
'tests/service-catalog/**/*.scenario.ts',
'tests/filter.scenario.ts',
'tests/modal-annotations.scenario.ts',
'tests/source-to-image.scenario.ts',
'tests/deploy-image.scenario.ts'],
},
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:
// $ yarn run test-gui --params.openshift true
openshift: 'false'
openshift: 'false',
// Set to 'true' to enable Service Catalog resources in the crud scenario.
servicecatalog: 'false'
}
};

Expand Down
5 changes: 4 additions & 1 deletion frontend/integration-tests/tests/crud.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ describe('Kubernetes resource CRUD operations', () => {
.set('buildconfigs', {kind: 'BuildConfig'})
.set('imagestreams', {kind: 'ImageStream'})
.set('routes', {kind: 'Route'});
const testObjs = browser.params.openshift === 'true' ? k8sObjs.merge(openshiftObjs) : k8sObjs;
const serviceCatalogObjs = OrderedMap<string, {kind: string, namespaced?: boolean}>()
.set('clusterservicebrokers', {kind: 'ClusterServiceBroker', namespaced: false});
let testObjs = browser.params.openshift === 'true' ? k8sObjs.merge(openshiftObjs) : k8sObjs;
testObjs = browser.params.servicecatalog === 'true' ? testObjs.merge(serviceCatalogObjs) : testObjs;

afterEach(() => {
checkLogs();
Expand Down
69 changes: 69 additions & 0 deletions frontend/integration-tests/tests/deploy-image.scenario.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* eslint-disable no-undef, no-unused-vars */

import { browser, $, element, by, ExpectedConditions as until, Key } from 'protractor';
import * as _ from 'lodash';

import { appHost, checkLogs, checkErrors, testName } from '../protractor.conf';
import * as crudView from '../views/crud.view';

describe('Deploy Image', () => {
afterEach(() => {
checkLogs();
checkErrors();
});

const appName = 'mysql';

describe('Deployment Configs page', () => {
it('has Create button', async() => {
await browser.get(`${appHost}/k8s/ns/${testName}/deploymentconfigs`);
await crudView.isLoaded();
expect((element(by.buttonText('Create'))).isPresent()).toBe(true);
});

it('can be used to navigate to the Deploy Image page', async() => {
await $('#item-create').click().then(() => browser.actions().sendKeys(Key.ARROW_DOWN, Key.ENTER).perform());
await browser.wait(until.presenceOf($('.co-deploy-image')));
expect((element(by.cssContainingText('#resource-title', 'Deploy Image'))).isPresent()).toBe(true);
});
});

describe('Deploy Image page', () => {
it('can be used to search for an image', async() => {
await $('#imageName').sendKeys(appName);
await $('.input-group-btn .btn-default').click();
await browser.wait(until.presenceOf($('.co-image-name-results__details')));
expect((element(by.cssContainingText('.co-image-name-results__heading', appName))).isPresent()).toBe(true);
});

it('can be used to create an app based on an image', async() => {
await $('.co-m-btn-bar .btn-primary').click();
await browser.wait(until.presenceOf(crudView.actionsDropdown));
expect(browser.getCurrentUrl()).toContain(`/${appName}`);
expect(crudView.resourceTitle.getText()).toEqual(appName);
});
});

describe('Deploy Image app', () => {
const resources = {
'deploymentconfigs': {kind: 'DeploymentConfig'},
'imagestreams': {kind: 'ImageStream'},
'services': {kind: 'Service'},
};

afterAll(async() => {
for (const resource in resources) {
if (resources.hasOwnProperty(resource)) {
const { kind } = resources[resource];
await crudView.deleteResource(resource, kind, appName);
}
}
});

_.each(resources, ({kind}, resource) => {
it(`displays detail view for new ${kind} instance`, async() => {
crudView.checkResourceExists(resource, appName);
});
});
});
});
2 changes: 2 additions & 0 deletions frontend/integration-tests/tests/olm/catalog.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ describe('Installing a service from the Catalog Sources', () => {
it('displays Catalog Sources with expected available services', async() => {
await sidenavView.clickNavLink(['Operators', 'Catalog Sources']);
await catalogView.isLoaded();
await catalogView.viewCatalogDetail('Red Hat Operators');
await catalogView.isLoaded();

openCloudServices.forEach(name => {
expect(catalogView.entryRowFor(name).isDisplayed()).toBe(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const defaultValueFor = <C extends SpecCapability | StatusCapability>(capability
}
};

xdescribe('Using OLM descriptor components', () => {
describe('Using OLM descriptor components', () => {
const testLabel = 'automatedTestName';
const prefixedCapabilities = new Set([SpecCapability.selector, SpecCapability.k8sResourcePrefix, StatusCapability.k8sResourcePrefix]);
const testCRD = {
Expand Down
8 changes: 5 additions & 3 deletions frontend/integration-tests/tests/olm/etcd.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ describe('Interacting with the etcd OCS', () => {
it('can be enabled from the Catalog Sources', async() => {
await sidenavView.clickNavLink(['Operators', 'Catalog Sources']);
await catalogView.isLoaded();
await catalogView.viewCatalogDetail('Red Hat Operators');
await catalogView.isLoaded();
await catalogView.createSubscriptionFor('etcd');
await browser.wait(until.presenceOf($('.ace_text-input')));
const content = await yamlView.editorContent.getText();
Expand Down Expand Up @@ -119,7 +121,7 @@ describe('Interacting with the etcd OCS', () => {
it('displays the raw YAML for the `EtcdCluster`', async() => {
await element(by.linkText('YAML')).click();
await browser.wait(until.presenceOf($('.yaml-editor--buttons')));
await $('.yaml-editor--buttons').element(by.buttonText('Save Changes')).click();
await $('.yaml-editor--buttons').element(by.buttonText('Save')).click();
await browser.wait(until.visibilityOf($('.alert-success')), 2000);

expect($('.alert-success').getText()).toContain(`${etcdcluster} has been updated to version`);
Expand Down Expand Up @@ -168,7 +170,7 @@ describe('Interacting with the etcd OCS', () => {
it('displays the raw YAML for the `EtcdBackup`', async() => {
await element(by.linkText('YAML')).click();
await browser.wait(until.presenceOf($('.yaml-editor--buttons')));
await $('.yaml-editor--buttons').element(by.buttonText('Save Changes')).click();
await $('.yaml-editor--buttons').element(by.buttonText('Save')).click();
await browser.wait(until.visibilityOf($('.alert-success')), 2000);

expect($('.alert-success').getText()).toContain(`${etcdbackup} has been updated to version`);
Expand Down Expand Up @@ -217,7 +219,7 @@ describe('Interacting with the etcd OCS', () => {
it('displays the raw YAML for the `EtcdRestore`', async() => {
await element(by.linkText('YAML')).click();
await browser.wait(until.presenceOf($('.yaml-editor--buttons')));
await $('.yaml-editor--buttons').element(by.buttonText('Save Changes')).click();
await $('.yaml-editor--buttons').element(by.buttonText('Save')).click();
await browser.wait(until.visibilityOf($('.alert-success')), 2000);

expect($('.alert-success').getText()).toContain(`${etcdrestore} has been updated to version`);
Expand Down
8 changes: 5 additions & 3 deletions frontend/integration-tests/tests/olm/prometheus.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ describe('Interacting with the Prometheus OCS', () => {
it('can be enabled from the Catalog Sources', async() => {
await sidenavView.clickNavLink(['Operators', 'Catalog Sources']);
await catalogView.isLoaded();
await catalogView.viewCatalogDetail('Red Hat Operators');
await catalogView.isLoaded();
await catalogView.createSubscriptionFor('Prometheus Operator');
await browser.wait(until.presenceOf($('.ace_text-input')));
const content = await yamlView.editorContent.getText();
Expand Down Expand Up @@ -116,7 +118,7 @@ describe('Interacting with the Prometheus OCS', () => {
it('displays the raw YAML for the `Prometheus`', async() => {
await element(by.linkText('YAML')).click();
await browser.wait(until.presenceOf($('.yaml-editor--buttons')));
await $('.yaml-editor--buttons').element(by.buttonText('Save Changes')).click();
await $('.yaml-editor--buttons').element(by.buttonText('Save')).click();
await browser.wait(until.visibilityOf($('.alert-success')), 1000);

expect($('.alert-success').getText()).toContain('example has been updated to version');
Expand Down Expand Up @@ -161,7 +163,7 @@ describe('Interacting with the Prometheus OCS', () => {
it('displays the raw YAML for the `Alertmanager`', async() => {
await element(by.linkText('YAML')).click();
await browser.wait(until.presenceOf($('.yaml-editor--buttons')));
await $('.yaml-editor--buttons').element(by.buttonText('Save Changes')).click();
await $('.yaml-editor--buttons').element(by.buttonText('Save')).click();
await browser.wait(until.visibilityOf($('.alert-success')), 1000);

expect($('.alert-success').getText()).toContain('alertmanager-main has been updated to version');
Expand Down Expand Up @@ -205,7 +207,7 @@ describe('Interacting with the Prometheus OCS', () => {
it('displays the raw YAML for the `ServiceMonitor`', async() => {
await element(by.linkText('YAML')).click();
await browser.wait(until.presenceOf($('.yaml-editor--buttons')));
await $('.yaml-editor--buttons').element(by.buttonText('Save Changes')).click();
await $('.yaml-editor--buttons').element(by.buttonText('Save')).click();
await browser.wait(until.visibilityOf($('.alert-success')), 1000);

expect($('.alert-success').getText()).toContain('example has been updated to version');
Expand Down
Loading

0 comments on commit 7a2980e

Please sign in to comment.