Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
718cd5e
Adding junitReporter to generate xml report
Dec 17, 2018
e02ba69
Add Dev Catalog tests to Jenkins CI
dtaylor113 Jan 15, 2019
a361219
Remove undesirable border at bottom of events page
rhamilto Jan 24, 2019
0b5c574
Refresh metrics when changing selected overview project
spadgett Jan 25, 2019
d6ccf98
Merge pull request #1138 from rhamilto/remove-events-border
openshift-merge-robot Jan 25, 2019
d86dcf4
Merge pull request #1141 from spadgett/overview-metrics-ns-change
openshift-merge-robot Jan 26, 2019
7ccd37e
Update console for monitoring changes
spadgett Dec 5, 2018
21d0a9d
Merge pull request #909 from spadgett/update-monitoring-proxy
openshift-merge-robot Jan 28, 2019
912df82
Fix bug where delete modal layout was broken
rhamilto Jan 28, 2019
936cc58
Update engine check to allow node 11
jhadvig Jan 27, 2019
3c3e548
Merge pull request #1143 from rhamilto/delete-modal
openshift-merge-robot Jan 28, 2019
c66b96e
Combine all scripts to single e2e test script
jcaianirh Jan 24, 2019
f7b32a5
Fix synthetic event warnings
spadgett Jan 28, 2019
2154628
Merge pull request #1136 from jcaianirh/e2e-teardown
openshift-merge-robot Jan 28, 2019
123a010
Merge pull request #1142 from jhadvig/readme-version
openshift-merge-robot Jan 29, 2019
c2aff03
Merge pull request #1144 from spadgett/fix-synthetic-event-error
openshift-merge-robot Jan 29, 2019
089218c
Remove unused Jenkins and e2e scripts
jcaianirh Jan 29, 2019
610726a
frontend: Adjust placement of contextDir in buildConfig
rebeccaalpert Jan 29, 2019
ce7d427
Merge pull request #1148 from rebeccaalpert/fix-missing-contextdir
openshift-merge-robot Jan 29, 2019
a4ddf42
Merge pull request #963 from rhrazdil/add_xml_reporter
openshift-merge-robot Jan 29, 2019
af38aff
Merge pull request #1082 from dtaylor113/dev-catalog-e2e-updates
openshift-merge-robot Jan 29, 2019
4f11a2e
Remove feature unavailable and mock code from cluster settings
TheRealJon Jan 30, 2019
fda4be5
Prevent initial scroll on operator hub page
jeff-phillips-18 Jan 30, 2019
07cf16a
Fix bug where catalog overlay is still open when canceling create
rhamilto Jan 30, 2019
a8aa686
move logging from the console to a file to simplify trouble-shooting …
jcaianirh Jan 30, 2019
d43e53f
Prevent operator icons from stretching in operator subscription page
jeff-phillips-18 Jan 30, 2019
f7af630
remove logging function since its now called only once.
jcaianirh Jan 30, 2019
3859bf7
Merge pull request #1151 from jeff-phillips-18/operator-hub
openshift-merge-robot Jan 30, 2019
378bdaf
Merge pull request #1153 from rhamilto/bz1670698
openshift-merge-robot Jan 30, 2019
415a38c
Incorporate vertical scroll shadows to modals
sg00dwin Jan 14, 2019
31e7ee9
Merge pull request #1150 from jeff-phillips-18/fixes
openshift-merge-robot Jan 30, 2019
1f5f864
Merge pull request #1152 from TheRealJon/remove-cluster-upgrade-beta-msg
openshift-merge-robot Jan 30, 2019
1847490
Merge pull request #1128 from sg00dwin/modal-vertical-scroll-shadows
openshift-merge-robot Jan 30, 2019
e2d2555
Fix bug where annotation remove icon is incorrect color
rhamilto Jan 31, 2019
43f12b9
Merge pull request #1157 from rhamilto/console-1246
openshift-merge-robot Jan 31, 2019
143128e
add filter bar to CSV list view
alecmerdler Jan 25, 2019
ceffd5a
Merge pull request #1155 from alecmerdler/ALM-880
openshift-merge-robot Jan 31, 2019
871c4ea
Fix bug where .co-m-horizontal-nav__menu__secondary does not scroll i…
rhamilto Jan 31, 2019
582967c
Merge pull request #1147 from jcaianirh/test-remove-jenkins
openshift-merge-robot Jan 31, 2019
df4b535
Fix show community operator dialog styles
spadgett Jan 31, 2019
e2e73d6
Merge pull request #1158 from spadgett/fix-community-operator-dialog-…
openshift-merge-robot Feb 1, 2019
6a8cd50
Merge pull request #1159 from rhamilto/console-1048
openshift-merge-robot Feb 1, 2019
3355960
Improve e2e test reliability
TheRealJon Jan 29, 2019
257cd00
Merge pull request #1160 from TheRealJon/test-flakes
openshift-merge-robot Feb 2, 2019
ffdd064
Update OpenShift flag detection to use an endpoint other than `/oapi`
spadgett Feb 4, 2019
941269c
Merge pull request #1164 from spadgett/fix-openshift-feature-detection
openshift-merge-robot Feb 4, 2019
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
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,21 +137,6 @@ Must set env vars `DOCKER_USER` and `DOCKER_PASSWORD` or have a valid `.dockercf
./build-docker-push.sh
```

### Jenkins automation

Master branch:

* Runs a build, pushes an image to Quay tagged with the commit sha

Pull requests:

* Runs a build when PRs are created or PR commits are pushed
* Comment with `Jenkins rebuild` to manually trigger a re-build
* Comment with `Jenkins push` to push an image to Quay, tagged with:
`pr_[pr #]_build_[jenkins build #]`

If changes are ever required for the Jenkins job configuration, apply them to both the [regular console job](https://jenkins-tectonic.prod.coreos.systems/job/console-build/) and [PR image job](https://jenkins-tectonic.prod.coreos.systems/job/console-pr-image/).

## Hacking

See [CONTRIBUTING](CONTRIBUTING.md) for workflow & convention details.
Expand Down
8 changes: 8 additions & 0 deletions cmd/bridge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const (
// Well-known location of Prometheus service for OpenShift. This is only accessible in-cluster.
openshiftPrometheusHost = "prometheus-k8s.openshift-monitoring.svc:9091"

// The tenancy service port (9092) performs RBAC checks for namespace-specific queries.
openshiftPrometheusTenancyHost = "prometheus-k8s.openshift-monitoring.svc:9092"

// Well-known location of Alert Manager service for OpenShift. This is only accessible in-cluster.
openshiftAlertManagerHost = "alertmanager-main.openshift-monitoring.svc:9094"
)
Expand Down Expand Up @@ -262,6 +265,11 @@ func main() {
HeaderBlacklist: []string{"Cookie", "X-CSRFToken"},
Endpoint: &url.URL{Scheme: "https", Host: openshiftPrometheusHost, Path: "/api"},
}
srv.PrometheusTenancyProxyConfig = &proxy.Config{
TLSClientConfig: monitoringProxyTLSConfig,
HeaderBlacklist: []string{"Cookie", "X-CSRFToken"},
Endpoint: &url.URL{Scheme: "https", Host: openshiftPrometheusTenancyHost, Path: "/api"},
}
srv.AlertManagerProxyConfig = &proxy.Config{
TLSClientConfig: monitoringProxyTLSConfig,
HeaderBlacklist: []string{"Cookie", "X-CSRFToken"},
Expand Down
7 changes: 7 additions & 0 deletions frontend/__mocks__/operatorHubItemsMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export const operatorHubTileViewPageProps = {
items: [
{
obj: amqPackageManifest,
installState: 'Installed',
kind: 'PackageManifest',
name: 'amq-streams',
uid: 'amq-streams/openshift-operator-lifecycle-manager',
Expand All @@ -327,6 +328,7 @@ export const operatorHubTileViewPageProps = {
},
{
obj: etcdPackageManifest,
installState: 'Not Installed',
kind: 'PackageManifest',
name: 'etcd',
uid: 'etcd/openshift-operator-lifecycle-manager',
Expand All @@ -346,6 +348,7 @@ export const operatorHubTileViewPageProps = {
categories: ['database'],
},
{ obj: federationv2PackageManifest,
installState: 'Not Installed',
kind: 'PackageManifest',
name: 'federationv2',
uid: 'federationv2/openshift-operator-lifecycle-manager',
Expand All @@ -365,6 +368,7 @@ export const operatorHubTileViewPageProps = {
categories: [],
},
{ obj: prometheusPackageManifest,
installState: 'Not Installed',
kind: 'PackageManifest',
name: 'prometheus',
uid: 'prometheus/openshift-operator-lifecycle-manager',
Expand All @@ -384,6 +388,7 @@ export const operatorHubTileViewPageProps = {
categories: ['monitoring', 'alerting'],
},
{ obj: svcatPackageManifest,
installState: 'Not Installed',
kind: 'PackageManifest',
name: 'svcat',
uid: 'svcat/openshift-operator-lifecycle-manager',
Expand Down Expand Up @@ -440,6 +445,8 @@ export const operatorHubTileViewPagePropsWithDummy = {
export const filterCounts = {
CoreOS: 1,
'Red Hat': 4,
Installed: 1,
'Not Installed': 4,
};

export const operatorHubCategories = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe(OperatorHubTileView.displayName, () => {
const filterItems = wrapper.find(FilterSidePanel.CategoryItem);
expect(filterItems.exists()).toBe(true);

expect(filterItems.length).toBe(2); // Filter by Provider
expect(filterItems.length).toBe(4); // Filter by Provider and Install State
filterItems.forEach((filter) => {
expect(filter.props().count).toBe(filterCounts[_.split(filter.childAt(0).text(), '(')[0]]);
});
Expand All @@ -107,14 +107,14 @@ describe(OperatorHubTileView.displayName, () => {
const filterItemsChanged = wrapper.find(FilterSidePanel.CategoryItem);
expect(filterItemsChanged.exists()).toBe(true);

expect(filterItemsChanged.length).toEqual(3); // Filter by Provider
expect(filterItemsChanged.length).toEqual(5); // Filter by Provider and Install State

wrapper.setProps(operatorHubTileViewPageProps);
wrapper.update();
const filterItemsFinal = wrapper.find(FilterSidePanel.CategoryItem);
expect(filterItemsFinal.exists()).toBe(true);

expect(filterItemsFinal.length).toEqual(2); // Filter by Provider
expect(filterItemsFinal.length).toEqual(4); // Filter by Provider and Install State
});

it('renders category tabs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as _ from 'lodash-es';
import { ClusterServiceVersionsDetailsPage, ClusterServiceVersionsDetailsPageProps, ClusterServiceVersionDetails, ClusterServiceVersionDetailsProps, ClusterServiceVersionsPage, ClusterServiceVersionsPageProps, ClusterServiceVersionList, ClusterServiceVersionHeader, ClusterServiceVersionRow, ClusterServiceVersionRowProps, CRDCard, CRDCardRow } from '../../../public/components/operator-lifecycle-manager/clusterserviceversion';
import { ClusterServiceVersionKind, ClusterServiceVersionLogo, ClusterServiceVersionLogoProps, referenceForProvidedAPI, CSVConditionReason } from '../../../public/components/operator-lifecycle-manager';
import { DetailsPage, ListPage, ListHeader, ColHead, List, ListInnerProps } from '../../../public/components/factory';
import { testClusterServiceVersion, testModel } from '../../../__mocks__/k8sResourcesMocks';
import { testClusterServiceVersion } from '../../../__mocks__/k8sResourcesMocks';
import { Timestamp, MsgBox, ResourceLink, ResourceKebab, ErrorBoundary, LoadingBox, ScrollToTopOnMount, SectionHeading } from '../../../public/components/utils';
import { referenceForModel } from '../../../public/module/k8s';
import { ClusterServiceVersionModel } from '../../../public/models';
Expand Down Expand Up @@ -120,8 +120,6 @@ describe(ClusterServiceVersionLogo.displayName, () => {
it('renders logo image from given base64 encoded image string', () => {
const image: ReactWrapper<React.ImgHTMLAttributes<any>> = wrapper.find('img');

expect(image.props().height).toEqual('40');
expect(image.props().width).toEqual('40');
expect(image.props().src).toEqual(`data:${testClusterServiceVersion.spec.icon.mediatype};base64,${testClusterServiceVersion.spec.icon.base64data}`);
});

Expand All @@ -130,8 +128,6 @@ describe(ClusterServiceVersionLogo.displayName, () => {
const fallbackImg: ReactWrapper<React.ImgHTMLAttributes<any>> = wrapper.find('img');

expect(fallbackImg.props().src).toEqual(operatorLogo);
expect(fallbackImg.props().height).toEqual('40');
expect(fallbackImg.props().width).toEqual('40');
});

it('renders ClusterServiceVersion name and provider from given spec', () => {
Expand Down Expand Up @@ -181,22 +177,21 @@ describe(CRDCard.displayName, () => {
const crd = testClusterServiceVersion.spec.customresourcedefinitions.owned[0];

it('renders a card with title, body, and footer', () => {
const wrapper = shallow(<CRDCard.WrappedComponent crd={crd} csv={testClusterServiceVersion} kindObj={testModel} />);
const wrapper = shallow(<CRDCard canCreate={true} crd={crd} csv={testClusterServiceVersion} />);

expect(wrapper.find('.co-crd-card__title').exists()).toBe(true);
expect(wrapper.find('.co-crd-card__body').exists()).toBe(true);
expect(wrapper.find('.co-crd-card__footer').exists()).toBe(true);
});

it('renders a link to create a new instance', () => {
const kindObj = _.cloneDeep({...testModel, verbs: ['create']});
const wrapper = shallow(<CRDCard.WrappedComponent crd={crd} csv={testClusterServiceVersion} kindObj={kindObj} />);
const wrapper = shallow(<CRDCard canCreate={true} crd={crd} csv={testClusterServiceVersion} />);

expect(wrapper.find('.co-crd-card__footer').find(Link).props().to).toEqual(`/k8s/ns/${testClusterServiceVersion.metadata.namespace}/${ClusterServiceVersionModel.plural}/${testClusterServiceVersion.metadata.name}/${referenceForProvidedAPI(crd)}/new`);
});

it('does not render link to create new instance if "create" not included in verbs for the model', () => {
const wrapper = shallow(<CRDCard.WrappedComponent crd={crd} csv={testClusterServiceVersion} kindObj={testModel} />);
it('does not render link to create new instance if `props.canCreate` is false', () => {
const wrapper = shallow(<CRDCard canCreate={false} crd={crd} csv={testClusterServiceVersion} />);

expect(wrapper.find('.co-crd-card__footer').find(Link).exists()).toBe(false);
});
Expand Down
33 changes: 16 additions & 17 deletions frontend/integration-tests/protractor.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ import { Config, browser, logging } from 'protractor';
import { execSync } from 'child_process';
import * as HtmlScreenshotReporter from 'protractor-jasmine2-screenshot-reporter';
import * as _ from 'lodash';
import { TapReporter } from 'jasmine-reporters';
import { TapReporter, JUnitXmlReporter } from 'jasmine-reporters';
import * as ConsoleReporter from 'jasmine-console-reporter';
import * as failFast from 'protractor-fail-fast';
import { createWriteStream} from 'fs';
import { format } from 'util';

const tap = !!process.env.TAP;

export const appHost = `${process.env.BRIDGE_BASE_ADDRESS || 'http://localhost:9000'}${(process.env.BRIDGE_BASE_PATH || '/').replace(/\/$/, '')}`;
export const testName = `test-${Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)}`;

const htmlReporter = new HtmlScreenshotReporter({dest: './gui_test_screenshots', inlineImages: true, captureOnlyFailedSpecs: true, filename: 'test-gui-report.html'});
const junitReporter = new JUnitXmlReporter({savePath: './gui_test_screenshots', consolidateAll: true});
const browserLogs: logging.Entry[] = [];

export const config: Config = {
Expand Down Expand Up @@ -49,30 +52,20 @@ export const config: Config = {
onPrepare: () => {
browser.waitForAngularEnabled(false);
jasmine.getEnv().addReporter(htmlReporter);
jasmine.getEnv().addReporter(junitReporter);
if (tap) {
jasmine.getEnv().addReporter(new TapReporter());
} else {
jasmine.getEnv().addReporter(new ConsoleReporter());
}
},
onComplete: async() => {
console.log('BEGIN BROWSER LOGS');
const consoleLogStream = createWriteStream('gui_test_screenshots/browser.log', { flags: 'a' });
browserLogs.forEach(log => {
const {level, message} = log;
const messageStr = _.isArray(message) ? message.join(' ') : message;
switch (level.name) {
case 'DEBUG':
console.log(level, messageStr);
break;
case 'SEVERE':
console.warn(level, messageStr);
break;
case 'INFO':
default:
console.info(level, messageStr);
}
consoleLogStream.write(`${format.apply(null, [`[${level.name}]`, messageStr])}\n`);
});
console.log('END BROWSER LOGS');

// Use projects if OpenShift so non-admin users can run tests. We need the fully-qualified name
// since we're using kubectl instead of oc.
Expand All @@ -95,8 +88,7 @@ export const config: Config = {
olm: ['tests/base.scenario.ts', 'tests/olm/descriptors.scenario.ts', 'tests/olm/catalog.scenario.ts', 'tests/olm/etcd.scenario.ts'],
olmUpgrade: ['tests/base.scenario.ts', 'tests/olm/update-channel-approval.scenario.ts'],
performance: ['tests/base.scenario.ts', 'tests/performance.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'],
catalog: ['tests/base.scenario.ts', 'tests/catalog.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', 'tests/developer-catalog.scenario.ts'],
operatorHub: ['tests/base.scenario.ts', 'tests/operator-hub/operator-hub.scenario.ts'],
overview: ['tests/base.scenario.ts', 'tests/overview/overview.scenario.ts'],
e2e: ['tests/base.scenario.ts',
Expand Down Expand Up @@ -124,7 +116,7 @@ export const config: Config = {
'tests/source-to-image.scenario.ts',
'tests/deploy-image.scenario.ts',
'tests/operator-hub/operator-hub.scenario.ts',
'tests/catalog.scenario.ts'],
'tests/developer-catalog.scenario.ts'],
},
params: {
// Set to 'true' to enable OpenShift resources in the crud scenario.
Expand Down Expand Up @@ -157,3 +149,10 @@ export const waitForCount = (elementArrayFinder, expectedCount) => {
return expectedCount >= actualCount;
};
};

export const waitForNone = (elementArrayFinder) => {
return async() => {
const count = await elementArrayFinder.count();
return count === 0;
};
};
Loading