Skip to content

Commit

Permalink
Test: Create minimal unit test for Maven jobs
Browse files Browse the repository at this point in the history
This change creates a minimal pom.xml for unit testing of Maven jobs
and creates a test job for the Maven Verify workflow. The intent here
is to create a small unit test that can quickly validate Maven
workflows and catch potential issues that maybe missed by a linter.

Signed-off-by: Thanh Ha <[email protected]>
  • Loading branch information
zxiiro committed Jul 24, 2024
1 parent 01288ad commit 69e0d87
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/zz-test-verify-maven.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 The Linux Foundation

name: Verify Maven Workflows

# yamllint disable-line rule:truthy
on: [push, pull_request]

jobs:
test-maven-verify:
uses: ./.github/workflows/compose-maven-verify.yaml
with:
GERRIT_BRANCH: ${{ github.ref }}
GERRIT_CHANGE_ID: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b
GERRIT_CHANGE_NUMBER: 123
GERRIT_CHANGE_URL: https://gerrit.example.org/c/test/+/123
GERRIT_EVENT_TYPE: test
GERRIT_PATCHSET_NUMBER: 1
GERRIT_PATCHSET_REVISION: 1
GERRIT_PROJECT: test
GERRIT_REFSPEC: main
MVN_POM_FILE: test/maven-project/pom.xml
7 changes: 7 additions & 0 deletions test/maven-project/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<project>
<modelVersion>4.0.0</modelVersion>

<groupId>org.linuxfoundation.test</groupId>
<artifactId>maven-test-app</artifactId>
<version>1</version>
</project>

0 comments on commit 69e0d87

Please sign in to comment.