Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Cico planner #2473

Merged
merged 88 commits into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
8604ecc
added cico_build for planner.
pranavgore09 Feb 19, 2018
ab527c3
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Feb 19, 2018
31fdeca
Added more comments
pranavgore09 Feb 20, 2018
5c39057
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Feb 20, 2018
ab65fc3
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Feb 21, 2018
0137925
MKDIR before docker build
pranavgore09 Feb 21, 2018
5d5f6e7
abs destination path
pranavgore09 Feb 21, 2018
6627517
update destination addr for copying
pranavgore09 Feb 21, 2018
db6dc22
update destination path for mount and copy
pranavgore09 Feb 21, 2018
2675cc6
add DEVSHIFT_USERNAME DEVSHIFT_PASSWORD in the build
pranavgore09 Feb 21, 2018
1bc21e6
remove accidentally commited directory
pranavgore09 Feb 21, 2018
6d85f42
Fix docker push params
pranavgore09 Feb 21, 2018
8c1e5d4
Fix docker push
pranavgore09 Feb 21, 2018
18be13c
tag the build with registry/repo:tag
pranavgore09 Feb 21, 2018
06e1d86
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Feb 26, 2018
2babc94
docker build and push
pranavgore09 Feb 26, 2018
daea144
Rebuild cico
pranavgore09 Feb 26, 2018
852ee58
run-functests
pranavgore09 Feb 26, 2018
c26d9f3
IMAGE TAG
pranavgore09 Feb 26, 2018
5ad32a0
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Feb 26, 2018
0ec2735
Use ID returned by `docker run`
pranavgore09 Feb 26, 2018
dcba94b
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Feb 27, 2018
23715d1
Merge branch 'master' into cico-planner
pranavgore09 Feb 28, 2018
a93f4f5
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Feb 28, 2018
ee59adb
Merge branch 'cico-planner' of github.com:pranavgore09/fabric8-planne…
pranavgore09 Mar 1, 2018
e68c6bc
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Mar 5, 2018
1acbe65
snapshot command
pranavgore09 Mar 5, 2018
e4fcc2f
trigger build
pranavgore09 Mar 5, 2018
7cc54aa
run only smoke tests
pranavgore09 Mar 5, 2018
d91c766
remove all tests
pranavgore09 Mar 5, 2018
5198c05
Fix pull registry
pranavgore09 Mar 5, 2018
b7c17d6
install gcc-c++
pranavgore09 Mar 5, 2018
850a821
Use image_name , required by cico-template
pranavgore09 Mar 5, 2018
1d591df
trigger build
pranavgore09 Mar 6, 2018
1bf9562
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Mar 8, 2018
b7ea66d
run func tests
pranavgore09 Mar 8, 2018
b0f5cd1
DIRECT_CONNECT=true added
pranavgore09 Mar 8, 2018
8218571
Merge branch 'master' into cico-planner
pranavgore09 Mar 13, 2018
e33da93
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Mar 13, 2018
9c15f94
Merge branch 'cico-planner' of github.com:pranavgore09/fabric8-planne…
pranavgore09 Mar 13, 2018
5bbe852
remove DIRECT_CONNECT=true
pranavgore09 Mar 13, 2018
66f1647
remove versions
pranavgore09 Mar 13, 2018
d26afe7
fix(tests): Use latest version of webdriver
jarifibrahim Mar 13, 2018
7001a53
Merge pull request #2 from jarifibrahim/pranav-cico
pranavgore09 Mar 13, 2018
e34b160
fix(CI/CD): Increase /dev/shm volume size of docker container
jarifibrahim Mar 13, 2018
407d980
Merge pull request #3 from jarifibrahim/pranav-cico
pranavgore09 Mar 13, 2018
fc583ab
Merge branch 'master' into cico-planner
pranavgore09 Mar 14, 2018
1f68de0
Revert "fix(tests): Use latest version of webdriver"
jarifibrahim Mar 14, 2018
f800026
Revert "remove versions"
jarifibrahim Mar 14, 2018
e576a59
Merge pull request #4 from jarifibrahim/pranav-cico
pranavgore09 Mar 14, 2018
a1aa913
fix(CI/CD): Increase /dev/shm size from 256mb to 512mb
jarifibrahim Mar 14, 2018
ba64122
Merge pull request #5 from jarifibrahim/pranav-cico
pranavgore09 Mar 14, 2018
6c26cc9
fix(CI/CD): Remove webdriver version
jarifibrahim Mar 14, 2018
bf03746
fix(tests): Wait for quickpreview to be ready
jarifibrahim Mar 14, 2018
9de5be5
Merge pull request #6 from jarifibrahim/pranav-cico
pranavgore09 Mar 14, 2018
853561c
Merge branch 'master' into cico-planner
pranavgore09 Mar 15, 2018
86cf597
Merge branch 'master' into cico-planner
pranavgore09 Mar 15, 2018
8830ff0
install specific version of chrome
pranavgore09 Mar 15, 2018
e151443
Merge branch 'cico-planner' of github.com:pranavgore09/fabric8-planne…
pranavgore09 Mar 15, 2018
1ab47f9
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Mar 15, 2018
5948896
use yum to install rpm
pranavgore09 Mar 15, 2018
f6620a4
revert chrome driver version
pranavgore09 Mar 15, 2018
7379406
fix(tests): Attempt to stabilize workitemTableTest
jarifibrahim Mar 15, 2018
6b62a18
Merge pull request #7 from jarifibrahim/pranav-cico
pranavgore09 Mar 15, 2018
53be071
fix(CI/CD) : comment why need to downgrade
pranavgore09 Mar 16, 2018
21114a5
Merge branch 'cico-planner' of github.com:pranavgore09/fabric8-planne…
pranavgore09 Mar 16, 2018
075b841
trigger build
pranavgore09 Mar 16, 2018
bc7aeab
fix typo
pranavgore09 Mar 19, 2018
48e381d
Merge remote-tracking branch 'upstream/master' into cico-planner
pranavgore09 Mar 19, 2018
35cdb82
fix typo
pranavgore09 Mar 19, 2018
9600ff2
fix(tests): Set webdriver version via env variable
jarifibrahim Mar 21, 2018
17e0213
Merge pull request #8 from jarifibrahim/pranav-cico
pranavgore09 Mar 21, 2018
1869dd2
Merge branch 'cico-planner' of github.com:pranavgore09/fabric8-planne…
pranavgore09 Mar 21, 2018
0d91900
install latest chrome
pranavgore09 Mar 21, 2018
4139eb1
install packages in Dockerfile only
pranavgore09 Mar 21, 2018
537acb7
remove the obvious
pranavgore09 Mar 21, 2018
6f26e83
Merge branch 'master' into cico-planner
pranavgore09 Mar 22, 2018
c7e39bb
Merge branch 'master' into cico-planner
pranavgore09 Mar 23, 2018
9709b18
Merge branch 'master' into cico-planner
pranavgore09 Mar 23, 2018
bea30b4
remove old comments
pranavgore09 Mar 23, 2018
b190458
trigger builds
pranavgore09 Mar 23, 2018
162a6fb
use the same user inside container as that of host
pranavgore09 Mar 25, 2018
2fb9c91
retrigger cico
pranavgore09 Mar 25, 2018
33effc3
Merge branch 'master' into cico-planner
pranavgore09 Mar 28, 2018
05ebc6a
Merge branch 'master' into cico-planner
pranavgore09 Mar 28, 2018
3df84f1
Merge branch 'master' into cico-planner
pranavgore09 Mar 29, 2018
7991b44
Merge branch 'master' into cico-planner
pranavgore09 Apr 3, 2018
2938d4c
Merge branch 'master' into cico-planner
pranavgore09 Apr 3, 2018
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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
node_modules
*~
*.swp
dist
runtime/node_modules
runtime/*~
runtime/*.swp
runtime/dist
17 changes: 2 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV NODE_VERSION 8.3.0

RUN yum -y update && \
yum install -y bzip2 fontconfig tar java-1.8.0-openjdk nmap-ncat psmisc gtk3 git \
python-setuptools xorg-x11-xauth wget unzip which \
python-setuptools xorg-x11-xauth wget unzip which gcc-c++ \
xfonts-100dpi libXfont GConf2 \
xorg-x11-fonts-75dpi xfonts-scalable xfonts-cyrillic \
ipa-gothic-fonts xorg-x11-utils xorg-x11-fonts-Type1 xorg-x11-fonts-misc && \
Expand All @@ -47,12 +47,10 @@ RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-
# && yum install -y firefox \
# && npm install -g karma-firefox-launcher

RUN npm install -g jasmine-node protractor

COPY runtime/tests/google-chrome.repo /etc/yum.repos.d/google-chrome.repo

RUN yum install -y google-chrome-stable

ENV DISPLAY=:99
ENV FABRIC8_USER_NAME=fabric8

RUN useradd --user-group --create-home --shell /bin/false ${FABRIC8_USER_NAME}
Expand All @@ -64,14 +62,3 @@ RUN mkdir $WORKSPACE
COPY . $WORKSPACE

WORKDIR $WORKSPACE/

RUN npm install \
&& npm run build \
&& cd runtime \
&& npm install \
&& npm link ../dist

VOLUME /dist
EXPOSE 8080

CMD cd /home/fabric8/fabric8-planner/runtime ; npm start
112 changes: 112 additions & 0 deletions cico_run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#!/bin/bash

# This file is supposed to be executed by CICO build (ci.centos.org/view/Devtools/)
# 1. Run tests for fabric8-planner
# 2. Create snapshot with fabric8-ui's master and fabric8-planner's current changes

# Show command before executing
set -x

# Exit on error
set -e

# Source environment variables of the jenkins slave
# that might interest this worker.
if [ -e "jenkins-env" ]; then
cat jenkins-env \
| grep -E "(JENKINS_URL|DEVSHIFT_USERNAME|DEVSHIFT_PASSWORD|GIT_BRANCH|GIT_COMMIT|BUILD_NUMBER|ghprbSourceBranch|ghprbActualCommit|BUILD_URL|ghprbPullId)=" \
| sed 's/^/export /g' \
> /tmp/jenkins-env
source /tmp/jenkins-env
fi

# We need to disable selinux for now, XXX
/usr/sbin/setenforce 0

# Get all the deps in
yum -y install docker
service docker start

# Build builder image
cp /tmp/jenkins-env .

mkdir -p fabric8-ui-dist
# Build fabric8-planner image
docker build -t fabric8-planner-builder .
# User root is required to run webdriver-manager update.
# This shouldn't be a problem for CI containers
# Chrome crashes on low size of /dev/shm. We need the --shm-size=256m flag.
CID=$(docker run --detach=true \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add -u $(shell id -u $(USER)):$(shell id -g $(USER))?

--shm-size=256m \
-u $(shell id -u $(USER)):$(shell id -g $(USER)) \
-v $(pwd)/fabric8-ui-dist:/home/fabric8/fabric8-planner/fabric8-ui-dist:Z \
--cap-add=SYS_ADMIN \
-t fabric8-planner-builder)


# Build fabric8-planner
docker exec $CID npm install
docker exec $CID npm run build

# Run unit tests
docker exec $CID npm run tests -- --unit

## Exec functional tests
docker exec $CID bash -c 'cd runtime; npm install'
docker exec $CID bash -c 'DEBUG=true HEADLESS_MODE=true WEBDRIVER_VERSION=2.37 ./scripts/run-functests.sh'

# Following steps will create a snapshot for testing

# Build and integrate planner with fabric8-ui
docker exec $CID npm pack dist/
docker exec $CID git clone https://github.com/fabric8-ui/fabric8-ui.git
docker exec $CID bash -c 'cd fabric8-ui; npm install'
docker exec $CID bash -c 'cd fabric8-ui && npm install ../*0.0.0-development.tgz'
docker exec $CID bash -c '''
export FABRIC8_WIT_API_URL="https://api.prod-preview.openshift.io/api/"
export FABRIC8_RECOMMENDER_API_URL="https://recommender.prod-preview.api.openshift.io"
export FABRIC8_FORGE_API_URL="https://forge.api.prod-preview.openshift.io"
export FABRIC8_SSO_API_URL="https://sso.prod-preview.openshift.io/"
export FABRIC8_AUTH_API_URL="https://auth.prod-preview.openshift.io/api/"

export OPENSHIFT_CONSOLE_URL="https://console.free-stg.openshift.com/console/"
export WS_K8S_API_SERVER="f8osoproxy-test-dsaas-preview.b6ff.rh-idev.openshiftapps.com:443"
export FABRIC8_FEATURE_TOGGLES_API_URL="f8osoproxy-test-dsaas-preview.b6ff.rh-idev.openshiftapps.com:443"

export PROXIED_K8S_API_SERVER="${WS_K8S_API_SERVER}"
export OAUTH_ISSUER="https://${WS_K8S_API_SERVER}"
export PROXY_PASS_URL="https://${WS_K8S_API_SERVER}"
export OAUTH_AUTHORIZE_URI="https://${WS_K8S_API_SERVER}/oauth/authorize"
export AUTH_LOGOUT_URI="https://${WS_K8S_API_SERVER}/connect/endsession?id_token={{id_token}}"

cd fabric8-ui && npm run build:prod
'''
# Copy dist and Dockerfile.deploy to host (via mounted dir)
docker exec $CID bash -c 'cd fabric8-ui; cp -r dist/ /home/fabric8/fabric8-planner/fabric8-ui-dist/'
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to copy because it is already mounted to the correct place (see https://github.com/fabric8-ui/fabric8-planner/pull/2473/files#r176723542).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pease see #2473 (comment)

docker exec $CID bash -c 'cd fabric8-ui; cp Dockerfile.deploy /home/fabric8/fabric8-planner/fabric8-ui-dist'

REGISTRY="push.registry.devshift.net"

# login first
if [ -n "${DEVSHIFT_USERNAME}" -a -n "${DEVSHIFT_PASSWORD}" ]; then
docker login -u ${DEVSHIFT_USERNAME} -p ${DEVSHIFT_PASSWORD} ${REGISTRY}
else
echo "Could not login, missing credentials for the registry"
exit 1
fi

# Build and push image
# Following code is not tested on local(remove this comment when tested with cico)
TAG="SNAPSHOT-PR-${ghprbPullId}"
IMAGE_REPO="fabric8-ui/fabric8-planner"

cd fabric8-ui-dist
docker build -t fabric8-planner-snapshot -f Dockerfile.deploy .
docker tag fabric8-planner-snapshot ${REGISTRY}/${IMAGE_REPO}:$TAG
docker push ${REGISTRY}/${IMAGE_REPO}:${TAG}

PULL_REGISTRY="registry.devshift.net"
image_name="${PULL_REGISTRY}/${IMAGE_REPO}:${TAG}"
echo "======= Snapshot can be created by running following command"
echo "docker run -e PROXY_PASS_URL=\"https://api.free-stg.openshift.com\" -p 8080:8080 ${image_name}"
echo "======="
4 changes: 2 additions & 2 deletions scripts/run-functests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ main() {
fi

export BASE_URL="${BASE_URL:-http://localhost:$PLANNER_PORT}"

export WEBDRIVER_VERSION="${WEBDRIVER_VERSION:-2.33}"
log.info "Entering $SCRIPT_DIR/../tests"
cd $SCRIPT_DIR/../tests
log.info "Running Functional Tests..."
./run.sh
./run.sh

clean_up
}
Expand Down
1 change: 1 addition & 0 deletions src/tests/specs/smoke/smokeTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('Planner Smoke Tests:', () => {

it('Check WorkItem creator name and image is reflected', async () => {
await planner.workItemList.clickWorkItem(c.workItemTitle1);
await planner.quickPreview.ready();
expect(await planner.quickPreview.hasCreator(c.user1)).toBeTruthy();
expect(await planner.quickPreview.hasCreatorAvatar(c.user_avatar)).toBeTruthy()
await planner.quickPreview.close();
Expand Down
1 change: 1 addition & 0 deletions src/tests/specs/workItemTableTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe('Work Item datatable list', () => {

it('work item should show updated title when switching from flat to tree view', async() => {
await planner.header.clickShowTree();
await planner.workItemList.ready();
await planner.workItemList.clickWorkItem(c.workItemTitle1);
await planner.quickPreview.updateTitle(c.updatedWorkItem.title);
expect(await planner.workItemList.hasWorkItem(c.updatedWorkItem.title)).toBeTruthy();
Expand Down
4 changes: 3 additions & 1 deletion src/tests/ui/planner/workitem-quickpreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ export class WorkItemQuickPreview extends ui.BaseElement {
await this.closeButton.ready();
await this.titleDiv.ready();
await this.descriptionDiv.ready();
await this.linksToggleButton.ready();
// We do not have the link button in current planner
// Uncomment when workitem linking is implemented
// await this.linksToggleButton.ready();
await this.commentsToggleButton.ready();
support.debug('... check if WorkItem preview is Ready - OK');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"license": "Apache 2",
"scripts": {
"tsc": "tsc",
"webdriver:update": "webdriver-manager update --versions.chrome 2.33",
"webdriver:start": "webdriver-manager start --versions.chrome 2.33",
"webdriver:update": "webdriver-manager update",
"webdriver:start": "webdriver-manager start",
"protractor": "protractor tmp/protractor.conf.js",
"test": "./run.sh"
},
Expand Down
4 changes: 2 additions & 2 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ start_webdriver() {
# Start selenium server just for this test run
log.info "Starting Webdriver and Selenium..."
log.info "Webdriver will log to:$GREEN $log_file"
npm run webdriver:update
npm run webdriver:start >> "$log_file" 2>&1 &
npm run webdriver:update -- --versions.chrome $WEBDRIVER_VERSION
npm run webdriver:start -- --versions.chrome $WEBDRIVER_VERSION >> "$log_file" 2>&1 &
webdriver_pid=$!
}

Expand Down