-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test: Create minimal unit test for Maven jobs #175
base: main
Are you sure you want to change the base?
Conversation
This change depends on #174 being merged as it requires to fix to the input parameter to choose an alternative pom.xml file. |
Looks like it also needs a GLOBAL_SETTINGS variable defined.
It doesn't need to have any real data. Something like this should be sufficient:
|
Alright this is ready to go but the unit test won't pass until the GLOBAL_SETTINGS variable is set as mentioned in my previous comment. Unfortunately I don't have the permissions to add it myself so someone in @lfit/release-engineering will have to add it and retest before this can be merged. |
To make the code cleaner it proposed #176 and removed the unused parameters that I was putting dummy values in for. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ok to me, but the job doesn't appear to be picking up the newly created GLOBAL_SETTINGS var that I added per your earlier statements.
It should be pulling from the repo's variables based on this code here. Calling Is there any security configuration in this repo preventing forked repos from fetching variables from the upstream repo? |
Oh I was reading the docs for repo variable configuration and it says this:
ref: https://github.com/lfit/releng-reusable-workflows/settings/variables/actions Yep, confirmed looks like variables definitely are not passed to forked repos. :( https://github.com/orgs/community/discussions/44322 I'll see if we can code around this somehow. |
Success! I had to make a small change to allow an input Since |
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. This change also modifies the compose-maven-verify job to accept a new parameter MVN_GLOBAL_SETTINGS which is optional and defaults the the current behaviour while allowing it to be overrided to provide an alternative global-settings which is necessary for this unit test to work on PRs from forked repos. Signed-off-by: Thanh Ha <[email protected]>
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.