Skip to content

Commit

Permalink
Merge pull request #1180 from NASA-AMMOS/refactor/e2eTests-to-java
Browse files Browse the repository at this point in the history
Convert e2eTests to Java
  • Loading branch information
Mythicaeda authored Oct 10, 2023
2 parents 1202433 + fac1ddd commit 40e845c
Show file tree
Hide file tree
Showing 66 changed files with 5,190 additions and 5,417 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: Test Results
path: "**/e2e-tests/test-results"
path: "**/e2e-tests/build/reports/tests/e2eTest"
- name: Upload DB Test Results as HTML
if: always()
uses: actions/upload-artifact@v3
Expand Down
1 change: 0 additions & 1 deletion e2e-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
test-results
7 changes: 0 additions & 7 deletions e2e-tests/.prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ docker compose -f docker-compose-test.yml up --build
After starting the development Docker compose stack the following commands can be issued to run these tests:

```sh
npm install && npm test
./gradlew e2e-tests:e2eTest
```
48 changes: 36 additions & 12 deletions e2e-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
plugins {
id 'com.github.node-gradle.node' version '5.0.0'
id 'java-library'
id 'jacoco'
}

node {
version = '16.17.0'
npmVersion = '8.15.0'
download = true
java {
toolchain {
languageVersion = JavaLanguageVersion.of(19)
}
}

task assemble {
dependsOn npmInstall
jacocoTestReport {
dependsOn test
reports {
xml.required = true
}
}

task build {
dependsOn assemble
task e2eTest(type: Test) {
if(file('.env').exists()) {
file('.env').readLines().each() {
def (key, value) = it.tokenize('=')
environment key, value
}
} else if(file('../.env').exists()){
file('../.env').readLines().each() {
def (key, value) = it.tokenize('=')
environment key, value
}
}
environment "PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD", 1
// Run the tests in parallel to improve performance
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
useJUnitPlatform()
}

task e2eTest(type: NpmTask) {
dependsOn npmInstall
args = ['run', 'test']
dependencies {
testImplementation 'com.microsoft.playwright:playwright:1.37.0'

testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'org.glassfish:javax.json:1.1.4'
testImplementation 'org.apache.commons:commons-lang3:3.13.0'

testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
}
Loading

0 comments on commit 40e845c

Please sign in to comment.