Skip to content

[incubator-kie-issues-1752] TCK failure-Lambda function returns null #6261

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

Merged
merged 25 commits into from
Mar 10, 2025

Conversation

bncriju
Copy link
Contributor

@bncriju bncriju commented Feb 20, 2025

Fixes apache/incubator-kie-issues#1752

Related PR: apache/incubator-kie-kogito-runtimes#3860

Added the fix for this problem and added test class and test methods to verify the same.

After and before the changes:

< "compliance-level-3/0092-feel-lambda","0092-feel-lambda-test-01","014","SUCCESS",""

"compliance-level-3/0092-feel-lambda","0092-feel-lambda-test-01","014","ERROR","FAILURE: 'decision_014_1' expected='25.0' but found='null'"

@bncriju bncriju requested a review from yesamer February 24, 2025 08:57
Copy link
Contributor

@yesamer yesamer left a comment

Choose a reason for hiding this comment

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

Minor points to address (formatting)

@@ -1,4 +1,5 @@
/**
/*
*
Copy link
Contributor

Choose a reason for hiding this comment

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

@bncriju Please remove line 2

@@ -0,0 +1,228 @@
/*
*
Copy link
Contributor

Choose a reason for hiding this comment

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

@bncriju Please remove line 2

}
if (o instanceof FEELFunction oFn) {
List<List<Param>> parameters = oFn.getParameters();
if(parameters.isEmpty()){
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if(parameters.isEmpty()){
if (parameters.isEmpty()) {

Please use the same formatting style of the code base

IntStream.range(0, argsGen.size()).allMatch(i -> fnT.argsGen.get(i).conformsTo(this.argsGen.get(i))) &&
this.returnGen.conformsTo(fnT.returnGen);
IntStream.range(0, argsGen.size()).allMatch(i -> fnT.argsGen.get(i).conformsTo(this.argsGen.get(i))) &&
this.returnGen.conformsTo(fnT.returnGen);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

@bncriju Please remove those 2 whitespaces

@yesamer yesamer added the DMN label Feb 24, 2025
List<List<Param>> parameters = oFn.getParameters();
if(parameters.isEmpty()){
//this is used to consider function as parameter
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

HI @bncriju
on second thought, I think we need to implement more check here, i.e. if the expected input/output of the current GenFnType are compatible with invoke methods of the provided function

@yesamer yesamer added the working_in_progress DO NOT MERGE! just testing PR label Feb 25, 2025
@gitgabrio gitgabrio marked this pull request as draft February 27, 2025 16:21
@kie-ci3
Copy link

kie-ci3 commented Feb 27, 2025

PR job #8 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 #6261 --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-6261/8/display/redirect

Test results:

  • PASSED: 23224
  • FAILED: 4

Those are the test failures:

org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithNoParameters
Expecting value to be true but was false
org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsAssignableValueWithFunction
Expecting value to be true but was false
org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithMatchingFunctionSignature
Expecting value to be true but was false
org.kie.dmn.feel.runtime.functions.BaseFEELFunctionTest.testIsCompatible
Expecting value to be true but was false

@kie-ci3
Copy link

kie-ci3 commented Mar 3, 2025

PR job #11 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 #6261 --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-6261/11/display/redirect

Test results:

  • PASSED: 22368
  • FAILED: 3

Those are the test failures:

org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithNoParameters
Expecting value to be true but was false
org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsAssignableValueWithFunction
Expecting value to be true but was false
org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithMatchingFunctionSignature
Expecting value to be true but was false

@kie-ci3
Copy link

kie-ci3 commented Mar 4, 2025

PR job #12 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 #6261 --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-6261/12/display/redirect

Test results:

  • PASSED: 23238
  • FAILED: 3

Those are the test failures:

org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithNoParameters
Expecting value to be true but was false
org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsAssignableValueWithFunction
Expecting value to be true but was false
org.kie.dmn.feel.lang.types.GenFnTypeTest.testIsInstanceOfWithMatchingFunctionSignature
Expecting value to be true but was false

@bncriju bncriju marked this pull request as ready for review March 5, 2025 15:13
@kie-ci3
Copy link

kie-ci3 commented Mar 6, 2025

PR job #17 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 #6261 --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-6261/17/display/redirect

Test results:

  • PASSED: 23245
  • FAILED: 1

Those are the test failures:

org.kie.dmn.feel.runtime.functions.BaseFEELFunctionTest.testIsCompatibleTrue
Expecting value to be true but was false

@yesamer
Copy link
Contributor

yesamer commented Mar 7, 2025

@bncriju Can you please check why the builds are failing?

@bncriju
Copy link
Contributor Author

bncriju commented Mar 7, 2025

Checked the build failures and found that this required changes in kogito runtimes repo. apache/incubator-kie-kogito-runtimes#3860 raised

@gitgabrio gitgabrio merged commit d12c472 into apache:main Mar 10, 2025
10 checks passed
@bncriju bncriju deleted the kie-issues#1752 branch March 10, 2025 10:22
saumya1singh pushed a commit to kiegroup/drools that referenced this pull request Mar 10, 2025
…pache#6261)

* null returned from lambda -issue fixed and added tests

* Restored singleton patterns for functions used for test

* Refactored test class and added more tests

* Added apache header on new class

* making doc correct

* checking invoke method and incorporating review comments

* [incubator-kie-issues#1752] WIP

* isCompatible method test and candidate method modification

* Util class added for BuiltInType. Used util method

* resolved merge conflicts

* reverting pom changes

* [incubator-kie-issues#1752] Improve parameters check on BaseFEELFunction

* [incubator-kie-issues#1752] Fix usage of BuiltInTypeUtils inside drl validation file

* adding tests

* [incubator-kie-issues#1752] WIP - Test suggestion

* test suggestions incorporated

* [incubator-kie-issues#1752] Managing arrays conversion. Begin BuiltInTypeUtilsTest

* tests updated

* license header corrected and managed unused imports

* license header corrected

---------

Co-authored-by: Gabriele-Cardosi <[email protected]>
saumya1singh pushed a commit to saumya1singh/drools that referenced this pull request Mar 13, 2025
…pache#6261)

* null returned from lambda -issue fixed and added tests

* Restored singleton patterns for functions used for test

* Refactored test class and added more tests

* Added apache header on new class

* making doc correct

* checking invoke method and incorporating review comments

* [incubator-kie-issues#1752] WIP

* isCompatible method test and candidate method modification

* Util class added for BuiltInType. Used util method

* resolved merge conflicts

* reverting pom changes

* [incubator-kie-issues#1752] Improve parameters check on BaseFEELFunction

* [incubator-kie-issues#1752] Fix usage of BuiltInTypeUtils inside drl validation file

* adding tests

* [incubator-kie-issues#1752] WIP - Test suggestion

* test suggestions incorporated

* [incubator-kie-issues#1752] Managing arrays conversion. Begin BuiltInTypeUtilsTest

* tests updated

* license header corrected and managed unused imports

* license header corrected

---------

Co-authored-by: Gabriele-Cardosi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DMN working_in_progress DO NOT MERGE! just testing PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lambda function returns null
5 participants