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

Conversation

andyduong1920
Copy link
Member

@andyduong1920 andyduong1920 commented Jan 15, 2025

What happened 👀

Raise an error if there is an issue with Remove Variable in the codebase. Mainly because the Variable name is invalid.

Insight 📝

As we are starting, apply remove variable to all repos, sometimes the developer uses an invalid variableName.

Example on this PR: https://github.com/Jollibee-Foods-Corporation/jfc-global-order-proc-api/pull/610

Proof Of Work 📹

Tested on https://github.com/Jollibee-Foods-Corporation/jfc-global-order-proc-api/actions/runs/12780673913/job/35627338969

image

@andyduong1920 andyduong1920 self-assigned this Jan 15, 2025
@andyduong1920 andyduong1920 changed the title Expose the log Expose the MUnit log and check for no variable Jan 15, 2025
@andyduong1920 andyduong1920 changed the title Expose the MUnit log and check for no variable Check for no variable in RemoveVariable component Jan 15, 2025
@andyduong1920 andyduong1920 changed the title Check for no variable in RemoveVariable component Check for no variable in RemoveVariable component from the log Jan 15, 2025
@@ -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: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants