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

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

bncriju
Copy link
Contributor

@bncriju bncriju commented Feb 20, 2025

Fixes apache/incubator-kie-issues#1752

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

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