Skip to content

Commit

Permalink
test: fixup test deps and report
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed Feb 5, 2024
1 parent b1fc584 commit b2c9a95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Check license header
uses: korandoru/hawkeye@v4
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
Expand All @@ -56,12 +56,20 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Verify
run: ./gradlew test
- name: Upload reports
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: reports
path: |
**/build/reports/
**/build/test-results/
required:
name: Required
Expand Down
1 change: 1 addition & 0 deletions plugin-maven/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies {

tasks.test {
dependsOn(tasks.publishToMavenLocal)
dependsOn(project(":lib").tasks.publishToMavenLocal)
systemProperty("project.basedir", projectDir)
systemProperty("project.version", version)
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@ void testExtension() throws Exception {
final Properties properties = new Properties();
properties.put("os-detector-maven-plugin.version", System.getProperty("project.version"));

final File basedir = new File(System.getProperty("project.basedir"), "src/test/resources/test-project-extension");
final InvocationRequest request = new DefaultInvocationRequest();
request.setPomFile(new File(basedir, "pom.xml"));
request.setPomFile(new File("src/test/resources/test-project-extension/pom.xml"));
request.setProperties(properties);
request.setGoals(Collections.singletonList("test"));

// FIXME :: test more versions
final String[] mavenVersions = new String[]{"mvn39"};
final String[] mavenVersions = new String[] {"mvn39"};
for (String mavenVersion : mavenVersions) {
final Invoker invoker = new DefaultInvoker();
invoker.setMavenExecutable(new File(basedir, mavenVersion + "/mvnw"));
invoker.setMavenExecutable(new File(mavenVersion + "/mvnw"));
final InvocationResult result = invoker.execute(request);
assertThat(result.getExitCode()).isZero();
assertThat(result.getExecutionException()).isNull();
Expand Down

0 comments on commit b2c9a95

Please sign in to comment.