Skip to content
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

Check for no variable in RemoveVariable component from the log #36

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/shared_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
java_version: ${{ inputs.java_version }}

- name: Run MUnit tests
uses: nimblehq/mulesoft-actions/test@v1.16.0
uses: nimblehq/mulesoft-actions/test@v1.19.0
with:
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
Expand Down
35 changes: 27 additions & 8 deletions test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ inputs:
default: .maven/settings.xml
upload_coverage_reports:
description: Upload MUnit reports to GitHub Actions Artifacts
default: 'true'
default: "true"
retention_days:
description: Artifact retention days
default: '1'
default: "1"
encryption_key:
description: Encryption key for secure properties
required: true
connected_app_client_id:
description: CloudHub connected app client ID
description: CloudHub connected app client ID
required: false
connected_app_client_secret:
description: CloudHub connected app client secret
description: CloudHub connected app client secret
required: false
business_group_id:
description: Business group ID
Expand All @@ -35,10 +35,10 @@ runs:
steps:
- name: Increase JAVA HEAP size
shell: bash
run: echo "JAVA_TOOL_OPTIONS=-Xmx5g -Xms1g" >> $GITHUB_ENV
run: echo "JAVA_TOOL_OPTIONS=-Xmx5g -Xms2g" >> $GITHUB_ENV
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increase the minimum memory here - hope that increases the test suite speed - I didn't benchmark it, just increase it as we have that capacity left on Github Action. If you don't like it, I can revert that back to 1GB 👌


- name: Test with Maven
run: mvn test --settings ${{ inputs.maven_settings_path }} -DsecuredKey=${ENCRYPTION_KEY}
run: mvn test --settings ${{ inputs.maven_settings_path }} -DsecuredKey=${ENCRYPTION_KEY} > munit-test-output.log 2>&1
shell: bash
env:
NEXUS_USERNAME: ${{ inputs.nexus_username }}
Expand All @@ -49,10 +49,29 @@ runs:
BUSINESS_GROUP_ID: ${{ inputs.business_group_id }}
JAVA_TOOL_OPTIONS: ${{ env.JAVA_TOOL_OPTIONS }}

- name: Upload MUnit reports
- name: Upload MUnit coverage reports
uses: actions/upload-artifact@v4
if: inputs.upload_coverage_reports == 'true'
with:
name: munit-test-reports
name: munit-test-coverage-reports
path: target/site/munit/coverage/
retention-days: ${{ inputs.retention_days }}

- name: Upload MUnit output
uses: actions/upload-artifact@v4
with:
name: munit-test-log-output
path: munit-test-output.log
retention-days: ${{ inputs.retention_days }}

- name: Load the MUnit log to StdOut
shell: bash
run: cat munit-test-output.log

- name: Check for no variable for RemoveFlowVariableProcessor in the log
shell: bash
run: |
if grep -q "Check the 'variableName' parameter in the 'remove-variable' component" munit-test-output.log; then
Copy link

@captainnimble captainnimble Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to capture variable name from the log, something like

if OUTPUT=$(grep -oP "There is no variable named '(.*)'. Check the 'variableName' parameter in the 'remove-variable' component" test.log); then
  echo "**Error**: Following variables is invalid for RemoveFlowVariableProcessor. $OUTPUT"
fi

But I can't test -P (Perl Compatible Regular Expressions – PCRE) on the local MAC.
I've tested with -oE option, but that not I've expected.
Could you help test with the Github workflow? I think it will be good if we know which variable is invalid.

echo "**Error**: One of the variables is invalid for RemoveFlowVariableProcessor. Please check the 'munit-test-output.log' file and search for the term 'There is no variable named' to locate the issue."
exit 1
fi