Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update-tests-and-CI #109

Merged
merged 9 commits into from
Jul 7, 2022
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
55 changes: 35 additions & 20 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Create open-source certs
run: |
cd cws-certs
chmod +x generate-certs.sh
./generate-certs.sh
- name: Download Logstash
uses: carlosperate/download-file-action@v1
with:
Expand All @@ -28,16 +33,12 @@ jobs:
run: |
cd install/logging/
ls -l
- name: Elasticsearch Setup
- name: Set up Elasticsearch
run: |
cd install/docker/es-only
docker-compose up -d
- name: Set up CWS database using Docker
run: docker run -d -p 3306:3306 -e MYSQL_DATABASE=cws_dev -e MYSQL_ROOT_PASSWORD=rootpw --name mdb103 mariadb:10.3
- name: Set up Elasticsearch
run: |
cd install/docker/es-only
docker-compose up -d
- name: Show Docker containers
run: |
sleep 5s
Expand All @@ -52,23 +53,37 @@ jobs:
chmod +x run_ci.sh
./run_ci.sh
shell: bash
- name: Show CWS Log
run: |
cd dist/console-only/cws/server/apache-tomcat-9.0.33/logs
ls -al
- name: Run Unit and Integration Tests
run: |
chmod +x test.sh
./test.sh
shell: bash
- name: Upload Jacoco report
uses: actions/upload-artifact@v3
with:
name: jacoco-report
path: jacoco-reports/aggregate/index.html


run-tests:
#run-tests:

runs-on: ubuntu-latest
#runs-on: ubuntu-latest

needs: build-cws
#needs: build-cws

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: CWS Unit and Integration Test Run
run: |
chmod +x test.sh
./test.sh
#steps:
#- uses: actions/checkout@v3
#- name: Set up JDK 8
#uses: actions/setup-java@v3
#with:
#java-version: '8'
#distribution: 'temurin'
#cache: maven
#- name: CWS Unit and Integration Test Run
#run: |
#chmod +x test.sh
#./test.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cws-service/src/main/resources/camunda/bpmn/*.bpmn

.keystore
cws_truststore.jks
cws.crt

cookies.txt
creds.txt
Expand Down
2 changes: 1 addition & 1 deletion ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Create a file that stores local hostname
echo "$THIS_HOSTNAME" > ${ROOT}/../cws-test/src/test/resources/hostname.txt
# echo "$THIS_HOSTNAME" > ${ROOT}/../cws-test/src/test/resources/hostname.txt

USER=${2}
DB_TYPE=${3}
Expand Down
2 changes: 1 addition & 1 deletion ci/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOSTNAME="localhost"
printf "\nHostname set to '%s'\n\n" $HOSTNAME

# Used in cws-test
echo "$HOSTNAME" > cws-test/src/test/resources/hostname.txt
echo "$HOSTNAME" > ../cws-test/src/test/resources/hostname.txt

SECURITY="CAMUNDA"

Expand Down
16 changes: 16 additions & 0 deletions cws-certs/generate-certs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/bash

# the following bash script creates open-source certs required to access CWS

# create private key and self-signed certificate within a keystore
keytool -genkey -keyalg RSA -dname "cn=cws, ou=cws, o=cws, l=cws, s=FL, c=US" -alias cws -keypass changeit -keystore .keystore -storepass changeit -validity 360 -keysize 2048

# extract self-signed certificate from keystore
keytool -export -alias cws -file cws.crt -keystore .keystore -storepass changeit

# insert self-signed certificate into truststore
keytool -import -alias cws -file cws.crt -keypass changeit -noprompt -keystore cws_truststore.jks -storepass changeit

# place open-source certs in appropriate directories
cp .keystore ../install
cp cws_truststore.jks ../install/tomcat_lib
2 changes: 1 addition & 1 deletion cws-test/src/test/java/jpl/cws/test/WebTestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected void initChromeDriver() {
ChromeOptions chromeOptions = new ChromeOptions();

// Turn on headless mode for Bamboo
chromeOptions.setHeadless(false);
chromeOptions.setHeadless(true);
chromeOptions.setAcceptInsecureCerts(true);

WebDriverManager.chromedriver().setup();
Expand Down