Skip to content

Commit

Permalink
Improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshanSS committed May 30, 2022
1 parent c18d2bc commit 5b91e99
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 247 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ jobs:
MONGO_INITDB_ROOT_PASSWORD: admin
mongodb-ssl:
image: rzhilkibaev/mongo-x509-auth-ssl:latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand All @@ -31,36 +33,39 @@ jobs:
run: |
./gradlew build
- name: Ballerina Build W/O tests
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
pack mongodb
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
- name: Ballerina Build W/ tests

- name: SSL Tests
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
test --groups mongodb --code-coverage mongodb
test --groups mongodb-ssl --code-coverage
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
MONGODB_HOST: mongodb
MONGODB_USER: admin
MONGODB_PASSWORD: admin
- name: Ballerina Build W/ tests (SSL)
WORKING_DIR: ./mongodb
MONGODB_HOST: mongodb-ssl
MONGODB_USER: C=US,ST=CA,L=San Francisco,O=Jaspersoft,OU=JSDev,CN=admin

- name: MongoDB Tests
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
test --groups mongodb-ssl --code-coverage
test --groups mongodb --code-coverage mongodb
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
WORKING_DIR: ./mongodb
MONGODB_HOST: mongodb-ssl
MONGODB_USER: C=US,ST=CA,L=San Francisco,O=Jaspersoft,OU=JSDev,CN=admin
MONGODB_HOST: mongodb
MONGODB_USER: admin
MONGODB_PASSWORD: admin


# Read the ballerina test results
- name: Read Ballerina Test Results
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ jobs:
MONGO_INITDB_ROOT_PASSWORD: admin
mongodb-ssl:
image: rzhilkibaev/mongo-x509-auth-ssl:latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Set up Java Environment
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

# Grant execute permission to the gradlew script
Expand All @@ -39,29 +41,29 @@ jobs:
run: |
./gradlew build
- name: Ballerina Build W/ tests
- name: SSL Tests
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
test --groups mongodb --code-coverage mongodb
test --groups mongodb-ssl --code-coverage
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
MONGODB_HOST: mongodb
MONGODB_USER: admin
MONGODB_PASSWORD: admin
WORKING_DIR: ./mongodb
MONGODB_HOST: mongodb-ssl
MONGODB_USER: C=US,ST=CA,L=San Francisco,O=Jaspersoft,OU=JSDev,CN=admin

- name: Ballerina Build W/ tests (SSL)
- name: MongoDB Tests
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
test --groups mongodb-ssl --code-coverage
test --groups mongodb --code-coverage mongodb
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
WORKING_DIR: ./mongodb
MONGODB_HOST: mongodb-ssl
MONGODB_USER: C=US,ST=CA,L=San Francisco,O=Jaspersoft,OU=JSDev,CN=admin
MONGODB_HOST: mongodb
MONGODB_USER: admin
MONGODB_PASSWORD: admin

# Read the ballerina test results
- name: Read Ballerina Test Results
Expand Down
40 changes: 6 additions & 34 deletions .github/workflows/dev-stg-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,13 @@ jobs:
runs-on: ubuntu-latest
env:
BALLERINA_${{ github.event.inputs.bal_central_environment }}_CENTRAL: true
services:
mongodb:
image: mongo:4.2.0
env:
# Following credentials are only used during testing in docker container
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
mongodb-ssl:
image: rzhilkibaev/mongo-x509-auth-ssl:latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand All @@ -41,29 +34,8 @@ jobs:
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build
- name: Ballerina Build W/ tests
uses: ballerina-platform/ballerina-action/@master
with:
args:
test --groups mongodb mongodb
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
MONGODB_HOST: mongodb
MONGODB_USER: admin
MONGODB_PASSWORD: admin
- name: Ballerina Build W/ tests (SSL)
uses: ballerina-platform/ballerina-action/@master
with:
args:
test --groups mongodb-ssl
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
WORKING_DIR: ./mongodb
MONGODB_HOST: mongodb-ssl
MONGODB_USER: C=US,ST=CA,L=San Francisco,O=Jaspersoft,OU=JSDev,CN=admin
- name: Ballerina Build W/O tests
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@master
with:
args:
Expand Down
42 changes: 8 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,15 @@ on:
jobs:
build:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:4.2.0
env:
# Following credentials are only used during testing in docker container
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
mongodb-ssl:
image: rzhilkibaev/mongo-x509-auth-ssl:latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Grant execute permission for gradlew
run: chmod +x gradlew

Expand All @@ -32,36 +26,16 @@ jobs:
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build
- name: Ballerina Build W/ tests
uses: ballerina-platform/ballerina-action/@master
with:
args:
test --groups mongodb mongodb
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
MONGODB_HOST: mongodb
MONGODB_USER: admin
MONGODB_PASSWORD: admin
- name: Ballerina Build W/ tests (SSL)
uses: ballerina-platform/ballerina-action/@master
with:
args:
test --groups mongodb-ssl
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
WORKING_DIR: ./mongodb
MONGODB_HOST: mongodb-ssl
MONGODB_USER: C=US,ST=CA,L=San Francisco,O=Jaspersoft,OU=JSDev,CN=admin
- name: Ballerina Build W/O tests
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@master
with:
args:
pack mongodb
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true

- name: Ballerina Push
uses: ballerina-platform/ballerina-action/@master
with:
Expand Down
Loading

0 comments on commit 5b91e99

Please sign in to comment.