-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Include Playwright and add some starter e2e API tests - Create testing workflow to execute tests in GH Actions - Report all test results as GH Action artifacts
- Loading branch information
Showing
20 changed files
with
4,361 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
push: | ||
branches: | ||
- develop | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
- name: Setup Postgres Client (psql) | ||
run: sudo apt-get install --yes postgresql-client | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Build Classes | ||
run: ./gradlew classes | ||
- name: Assemble | ||
run: ./gradlew assemble | ||
- name: Start Services | ||
run: | | ||
docker compose -f ./e2e-tests/docker-compose-test.yml up -d --build | ||
docker images | ||
docker ps -a | ||
- name: Sleep for 30 Seconds | ||
run: sleep 30s | ||
shell: bash | ||
- name: Run Unit Tests | ||
run: ./gradlew test | ||
- name: Run E2E Tests | ||
run: ./gradlew e2eTest | ||
- name: Report JUnit Test Results | ||
uses: dorny/test-reporter@v1 | ||
if: always() | ||
with: | ||
name: ☕ JUnit Results | ||
path: "**/build/test-results/**/TEST-*.xml" | ||
reporter: java-junit | ||
- name: Upload JUnit Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ☕ JUnit Results | ||
path: "**/build/test-results/**/TEST-*.xml" | ||
- name: Upload Playwright Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: 🎭 Playwright Results | ||
path: ./e2e-tests/test-results | ||
- name: Print Logs for Services | ||
run: docker compose -f ./e2e-tests/docker-compose-test.yml logs -t | ||
- name: Stop Services | ||
run: | | ||
docker ps -a | ||
docker compose -f ./e2e-tests/docker-compose-test.yml down | ||
docker ps -a | ||
- name: Prune Volumes | ||
run: docker volume prune --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ java { | |
} | ||
} | ||
|
||
test { | ||
task e2eTest(type: Test) { | ||
useJUnitPlatform() | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
test-results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"printWidth": 120, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# aerie-e2e-tests | ||
|
||
This directory contains automated end-to-end tests for Aerie. | ||
|
||
## Getting Started | ||
|
||
```sh | ||
npm install | ||
npm test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
plugins { | ||
id 'com.github.node-gradle.node' version '3.1.1' | ||
} | ||
|
||
node { | ||
version = '16.4.0' | ||
npmVersion = '8.5.0' | ||
download = true | ||
} | ||
|
||
task assemble { | ||
dependsOn npmInstall | ||
} | ||
|
||
task build { | ||
dependsOn assemble | ||
} | ||
|
||
task e2eTest(type: NpmTask) { | ||
dependsOn npmInstall | ||
args = ['run', 'test'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# This compose file is used for end-to-end testing the Aerie services. | ||
# See .github/workflows/test.yml for how this file is utilized. | ||
|
||
version: '3.7' | ||
services: | ||
aerie_commanding: | ||
build: | ||
context: ./../command-expansion-server | ||
dockerfile: Dockerfile | ||
container_name: aerie_commanding | ||
depends_on: ['postgres'] | ||
environment: | ||
LOG_FILE: console | ||
LOG_LEVEL: debug | ||
MERLIN_GRAPHQL_URL: http://hasura:8080/v1/graphql | ||
COMMANDING_SERVER_PORT: 3000 | ||
COMMANDING_DB: aerie_commanding | ||
COMMANDING_DB_PASSWORD: aerie | ||
COMMANDING_DB_PORT: 5432 | ||
COMMANDING_DB_SERVER: postgres | ||
COMMANDING_DB_USER: aerie | ||
COMMANDING_LOCAL_STORE: /usr/src/app/commanding_file_store | ||
image: aerie_commanding | ||
ports: ['3000:3000'] | ||
restart: always | ||
volumes: | ||
- ./../command-expansion-server:/app:cached | ||
- aerie_file_store:/usr/src/app/commanding_file_store | ||
aerie_gateway: | ||
container_name: aerie_gateway | ||
depends_on: ['postgres'] | ||
environment: | ||
AUTH_TYPE: none | ||
GQL_API_URL: http://localhost:8080/v1/graphql | ||
LOG_FILE: console | ||
LOG_LEVEL: debug | ||
NODE_TLS_REJECT_UNAUTHORIZED: '0' | ||
PORT: 9000 | ||
POSTGRES_AERIE_MERLIN_DB: aerie_merlin | ||
POSTGRES_AERIE_SCHEDULER_DB: aerie_scheduler | ||
POSTGRES_AERIE_UI_DB: aerie_ui | ||
POSTGRES_HOST: postgres | ||
POSTGRES_PASSWORD: aerie | ||
POSTGRES_PORT: 5432 | ||
POSTGRES_USER: aerie | ||
image: 'ghcr.io/nasa-ammos/aerie-gateway:develop' | ||
ports: ['9000:9000'] | ||
restart: always | ||
volumes: | ||
- aerie_file_store:/app/files | ||
aerie_merlin: | ||
build: | ||
context: ./../merlin-server | ||
dockerfile: Dockerfile | ||
container_name: aerie_merlin | ||
depends_on: ['postgres'] | ||
environment: | ||
MERLIN_DB: 'aerie_merlin' | ||
MERLIN_DB_PASSWORD: 'aerie' | ||
MERLIN_DB_PORT: 5432 | ||
MERLIN_DB_SERVER: 'postgres' | ||
MERLIN_DB_USER: 'aerie' | ||
MERLIN_LOCAL_STORE: /usr/src/app/merlin_file_store | ||
MERLIN_PORT: 27183 | ||
JAVA_OPTS: > | ||
-Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG | ||
-Dorg.slf4j.simpleLogger.log.com.zaxxer.hikari=INFO | ||
-Dorg.slf4j.simpleLogger.logFile=System.err | ||
image: aerie_merlin | ||
ports: ['27183:27183', '5005:5005'] | ||
restart: always | ||
volumes: | ||
- aerie_file_store:/usr/src/app/merlin_file_store | ||
aerie_scheduler: | ||
build: | ||
context: ./../scheduler-server | ||
dockerfile: Dockerfile | ||
container_name: aerie_scheduler | ||
depends_on: ['aerie_merlin', 'postgres'] | ||
environment: | ||
MERLIN_GRAPHQL_URL: http://hasura:8080/v1/graphql | ||
MERLIN_LOCAL_STORE: /usr/src/app/merlin_file_store | ||
SCHEDULER_DB: 'aerie_scheduler' | ||
SCHEDULER_DB_PASSWORD: 'aerie' | ||
SCHEDULER_DB_PORT: 5432 | ||
SCHEDULER_DB_SERVER: 'postgres' | ||
SCHEDULER_DB_USER: 'aerie' | ||
SCHEDULER_LOCAL_STORE: /usr/src/app/scheduler_file_store | ||
SCHEDULER_LOGGING: 'true' | ||
SCHEDULER_OUTPUT_MODE: UpdateInputPlanWithNewActivities | ||
SCHEDULER_PORT: 27193 | ||
SCHEDULER_RULES_JAR: /usr/src/app/merlin_file_store/scheduler_rules.jar | ||
JAVA_OPTS: > | ||
-Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG | ||
-Dorg.slf4j.simpleLogger.log.com.zaxxer.hikari=INFO | ||
-Dorg.slf4j.simpleLogger.logFile=System.err | ||
image: aerie_scheduler | ||
ports: ['27193:27193', '5006:5005'] | ||
restart: always | ||
volumes: | ||
- aerie_file_store:/usr/src/app/merlin_file_store | ||
hasura: | ||
container_name: hasura | ||
depends_on: ['postgres'] | ||
environment: | ||
AERIE_MERLIN_DATABASE_URL: postgres://aerie:aerie@postgres:5432/aerie_merlin | ||
AERIE_SCHEDULER_DATABASE_URL: postgres://aerie:aerie@postgres:5432/aerie_scheduler | ||
AERIE_UI_DATABASE_URL: postgres://aerie:aerie@postgres:5432/aerie_ui | ||
HASURA_GRAPHQL_DEV_MODE: 'true' | ||
HASURA_GRAPHQL_ENABLE_CONSOLE: 'true' | ||
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log | ||
HASURA_GRAPHQL_LOG_LEVEL: info | ||
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://aerie:aerie@postgres:5432/aerie_hasura | ||
HASURA_GRAPHQL_METADATA_DIR: /hasura-metadata | ||
image: 'hasura/graphql-engine:v2.2.0.cli-migrations-v3' | ||
ports: ['8080:8080'] | ||
restart: always | ||
volumes: | ||
- ./../deployment/hasura/metadata:/hasura-metadata | ||
postgres: | ||
container_name: postgres | ||
environment: | ||
POSTGRES_DB: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
image: postgres:14.1 | ||
ports: ['5432:5432'] | ||
restart: always | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
- ./../deployment/postgres-init-db:/docker-entrypoint-initdb.d | ||
|
||
volumes: | ||
aerie_file_store: | ||
postgres_data: |
Oops, something went wrong.