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

Jac Test Case Parameter Passisng #1121

Open
ChrisIsKing opened this issue May 8, 2023 · 1 comment
Open

Jac Test Case Parameter Passisng #1121

ChrisIsKing opened this issue May 8, 2023 · 1 comment

Comments

@ChrisIsKing
Copy link
Collaborator

ChrisIsKing commented May 8, 2023

Is your feature request related to a problem? Please describe.
When writing core test cases for jaseci actions convention assumes that walkers test static input cases. e.g

@pytest.mark.order(2)
    @jac_testcase("bi_enc.jac", "test_bi_enc_infer")
    def test_biencoder_infer(self, ret):
        self.assertEqual(ret["success"], True)
walker test_bi_enc_infer{
    can bi_enc.infer;
    report bi_enc.infer(["Share my location with Hillary's sister"],["searchplace","getplacedetails","bookrestaurant","gettrafficinformation","compareplaces","sharecurrentlocation","requestride","getdirections","shareeta","getweather"],"text","text");
}

However, test cases can run on dynamic input sources that need to be managed within Python and need a seamless way of passing this in the @jac_testcase decorator

Describe the solution you'd like

data = ["text"]

@pytest.mark.order(2)
    @jac_testcase("bi_enc.jac", "test_bi_enc_infer", ctx=data)
    def test_biencoder_infer(self, ret):
        self.assertEqual(ret["success"], True)
walker test_bi_enc_infer{
    has data;
    can bi_enc.infer;
    report bi_enc.infer(data);
}

Describe alternatives you've considered
An alternative is loading & handling the data in JAC or writing several test walkers.

If this feature request is accepted, would you be willing to work on a PR?
Yes. I suspect a simple mod to test_core.py would solve this but its unclear how parameters are passed to JsOrc.master()

Additional context
Add any other context or screenshots about the feature request here.

@ChrisIsKing
Copy link
Collaborator Author

Seems like this is catered for in part by self.call but I don't think the parameters end anywhere. See here

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

No branches or pull requests

1 participant