Skip to content

Commit

Permalink
Run tests more efficiently
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbusche authored May 21, 2023
1 parent d4c6efc commit aa80a31
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 32 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
java-version: [ 17, 20 ]

steps:
- uses: actions/checkout@v3.5.2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
Expand All @@ -23,10 +23,27 @@ jobs:
java-version: ${{ matrix.java-version }}
- name: Setup and execute Gradle
uses: gradle/gradle-build-action@v2
- name: Run Gradle task
- name: Run Gradle build
shell: bash
run: >-
./gradlew build --no-daemon --info
-Dorg.gradle.parallel=true
-Dorg.gradle.caching=true
-Dorg.gradle.jvmargs="-Xms4g -Xmx6g -XX:+HeapDumpOnOutOfMemoryError -XX:MaxMetaspaceSize=512m"
export SPRING_PROFILES_ACTIVE=test && ./gradlew build --no-daemon --info
- name: Generate file
run: |
cd build/libs/
mv trap-*.jar trap.jar
java -jar trap.jar
ls -ltra
test -f league-data-*.xlsx || exit 1
# file1size=stat -c %s league-data-*.xlsx
# echo "file 1 size successful"
# file2size=stat -c %s ../../src/main/resources/main-template.xlsx
# echo "file 2 size successful"
# echo "file1size"
# echo $file1size
# echo "file2size"
# echo $file2size
# if("file1size" -lt "file2size");then
# echo "file 1 is smaller"
# fi


4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ dependencies {
tasks.withType<Test> {
useJUnitPlatform()
}

tasks.getByName<Jar>("jar") {
enabled = false
}
2 changes: 2 additions & 0 deletions src/main/java/trap/report/CommandLineAppStartupRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import lombok.RequiredArgsConstructor;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

@Profile("!test")
@Component
@RequiredArgsConstructor
public class CommandLineAppStartupRunner implements CommandLineRunner {
Expand Down
26 changes: 0 additions & 26 deletions src/test/java/trap/report/ReportHelperTest.java

This file was deleted.

0 comments on commit aa80a31

Please sign in to comment.