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

wasm: String concat set ordering #2924

Closed
patrick-east opened this issue Nov 18, 2020 · 0 comments · Fixed by #2999
Closed

wasm: String concat set ordering #2924

patrick-east opened this issue Nov 18, 2020 · 0 comments · Fixed by #2999

Comments

@patrick-east
Copy link
Contributor

This test case test/cases/testdata/strings/test-strings-0883.yaml is failing when run with Wasm with the following result:

expected [{"x": "1,2,3"}] but got [{"x": "3,2,1"}]

The policy is attempting to concatenate a set of strings, and it seems that the Wasm implementation does so in a different order. Since it was a set initially (non ordered) it doesn't appear to be an invalid result, but we need some way to better handle these test cases. The yaml specifies:

  want_result:
  - x: 1,2,3

Which implies a string value with a specific order.

srenatus added a commit to srenatus/opa that referenced this issue Dec 11, 2020
Since anything can happen, we now list the possibilities (3! = 6),
and check that any of them was the result.

Fixes open-policy-agent#2924.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
tsandall pushed a commit that referenced this issue Dec 14, 2020
Since anything can happen, we now list the possibilities (3! = 6),
and check that any of them was the result.

Fixes #2924.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant