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

kie-issues#1541: Add testing models into kie-dmn-test-resources #6135

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

jomarko
Copy link
Contributor

@jomarko jomarko commented Oct 22, 2024

This PR is related to: apache/incubator-kie-kogito-apps#2120 where we are adding new unit tests using DMN models from the drools/kie-dmn/kie-dmn-test-resources

Thank you for submitting this pull request

NOTE!: Double-check the target branch for this PR.
The default is main so it will target Drools 8 / Kogito.

Ports If a forward-port or a backport is needed, paste the forward port PR here

Issue: (please edit the GitHub Issues link if it exists)

referenced Pull Requests: (please edit the URLs of referenced pullrequests if they exist)

  • paste the link(s) from GitHub here
  • link 2
  • link 3 etc.
How to replicate CI configuration locally?

Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.

build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.

How to retest this PR or trigger a specific build:
  • for pull request and downstream checks

    • Push a new commit to the PR. An empty commit would be enough.
  • for a full downstream build

    • for github actions job: add the label run_fdb
  • for Jenkins PR check only

This PR is related to: apache/incubator-kie-kogito-apps#2120 where we are adding new unit tests using DMN models from the drools/kie-dmn/kie-dmn-test-resources
@jomarko jomarko added the DMN label Oct 22, 2024
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" ?>
Copy link
Contributor

@gitgabrio gitgabrio Oct 22, 2024

Choose a reason for hiding this comment

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

I think it would be better a more descriptive name for the model: what about something like "MultipleHitRules" - or similar ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with the proposed name. Will push the change shortly.

@@ -0,0 +1,328 @@
<?xml version="1.0" encoding="UTF-8" ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @jomarko
But this model is already present: see RiskScore_Simple.
Please correct me if the two are semantically different

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are semantically slightly different.

The existing RiskScore_Simple contains two Decision nodes in a sequence. Firstly, a decision table is evaluated in the first decision node and then the model proceeds to the second decision node, where a conditional expression is evaluated.

The new RiskScore_Conditional contains a single Decision node, where expressions are nested so it is Risk Score: {if: (condition), then: {DecisionTable 1}, else: {DecisionTable 2}}

I see this model as useful to demonstrate evaluationHitIds are returned for all levels of the expressions - we return as conditional branch id, so decision table rule id.

Copy link
Contributor Author

@jomarko jomarko left a comment

Choose a reason for hiding this comment

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

Thank you for review.

@@ -0,0 +1,328 @@
<?xml version="1.0" encoding="UTF-8" ?>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are semantically slightly different.

The existing RiskScore_Simple contains two Decision nodes in a sequence. Firstly, a decision table is evaluated in the first decision node and then the model proceeds to the second decision node, where a conditional expression is evaluated.

The new RiskScore_Conditional contains a single Decision node, where expressions are nested so it is Risk Score: {if: (condition), then: {DecisionTable 1}, else: {DecisionTable 2}}

I see this model as useful to demonstrate evaluationHitIds are returned for all levels of the expressions - we return as conditional branch id, so decision table rule id.

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" ?>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with the proposed name. Will push the change shortly.

@kie-ci3
Copy link

kie-ci3 commented Oct 22, 2024

PR job #1 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u #6135 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6135/1/display/redirect

Test results:

  • PASSED: 22666
  • FAILED: 1

Those are the test failures:

org.kie.dmn.validation.ValidatorTest.validateAllValidSharedModels
Expecting empty but was: [Message [id=0, level=WARNING, path=valid_models/DMNv1_5/Collections.dmn, line=28, column=-1
text=DMN: Decision table with single output on node 'Statistics' should not have output name (DMN id: _BAB25151-3529-4601-9BB0-B221F29887C0, The referenced element should not have a name set) ]]

@kie-ci3
Copy link

kie-ci3 commented Oct 22, 2024

PR job #2 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u #6135 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-6135/2/display/redirect

Test results:

  • PASSED: 22666
  • FAILED: 1

Those are the test failures:

org.kie.dmn.validation.ValidatorTest.validateAllValidSharedModels
Expecting empty but was: [Message [id=0, level=WARNING, path=valid_models/DMNv1_5/MultipleHitRules.dmn, line=28, column=-1
text=DMN: Decision table with single output on node 'Statistics' should not have output name (DMN id: _BAB25151-3529-4601-9BB0-B221F29887C0, The referenced element should not have a name set) ]]

@gitgabrio gitgabrio merged commit 273b242 into apache:main Oct 23, 2024
7 of 9 checks passed
rgdoliveira pushed a commit to rgdoliveira/drools that referenced this pull request Oct 24, 2024
…he#6135)

* kie-issues#1541: Add testing models into kie-dmn-test-resources

This PR is related to: apache/incubator-kie-kogito-apps#2120 where we are adding new unit tests using DMN models from the drools/kie-dmn/kie-dmn-test-resources

* Collections.dmn -> MultipleHitRules.dmn

* Remove <output/> name attribute
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.

4 participants