{"action":"closed","issue":{"url":"https://api.github.com/repos/ScottLogic/data-engineering-generator/issues/289","repository_url":"https://api.github.com/repos/ScottLogic/data-engineering-generator","labels_url":"https://api.github.com/repos/ScottLogic/data-engineering-generator/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/ScottLogic/data-engineering-generator/issues/289/comments","events_url":"https://api.github.com/repos/ScottLogic/data-engineering-generator/issues/289/events","html_url":"https://github.com/ScottLogic/data-engineering-generator/issues/289","id":391115584,"node_id":"MDU6SXNzdWUzOTExMTU1ODQ=","number":289,"title":"Cucumber if: Running an if with an else statement containing an ofType constraint did not produce all combinations available as expected","user":{"login":"cakehurstryan","id":43746958,"node_id":"MDQ6VXNlcjQzNzQ2OTU4","avatar_url":"https://avatars1.githubusercontent.com/u/43746958?v=4","gravatar_id":"","url":"https://api.github.com/users/cakehurstryan","html_url":"https://github.com/cakehurstryan","followers_url":"https://api.github.com/users/cakehurstryan/followers","following_url":"https://api.github.com/users/cakehurstryan/following{/other_user}","gists_url":"https://api.github.com/users/cakehurstryan/gists{/gist_id}","starred_url":"https://api.github.com/users/cakehurstryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakehurstryan/subscriptions","organizations_url":"https://api.github.com/users/cakehurstryan/orgs","repos_url":"https://api.github.com/users/cakehurstryan/repos","events_url":"https://api.github.com/users/cakehurstryan/events{/privacy}","received_events_url":"https://api.github.com/users/cakehurstryan/received_events","type":"User","site_admin":false},"labels":[{"id":977096304,"node_id":"MDU6TGFiZWw5NzcwOTYzMDQ=","url":"https://api.github.com/repos/ScottLogic/data-engineering-generator/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":1033107125,"node_id":"MDU6TGFiZWwxMDMzMTA3MTI1","url":"https://api.github.com/repos/ScottLogic/data-engineering-generator/labels/generator","name":"generator","color":"0b8e67","default":false}],"state":"closed","locked":false,"assignee":{"login":"sl-slaing","id":44162572,"node_id":"MDQ6VXNlcjQ0MTYyNTcy","avatar_url":"https://avatars3.githubusercontent.com/u/44162572?v=4","gravatar_id":"","url":"https://api.github.com/users/sl-slaing","html_url":"https://github.com/sl-slaing","followers_url":"https://api.github.com/users/sl-slaing/followers","following_url":"https://api.github.com/users/sl-slaing/following{/other_user}","gists_url":"https://api.github.com/users/sl-slaing/gists{/gist_id}","starred_url":"https://api.github.com/users/sl-slaing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sl-slaing/subscriptions","organizations_url":"https://api.github.com/users/sl-slaing/orgs","repos_url":"https://api.github.com/users/sl-slaing/repos","events_url":"https://api.github.com/users/sl-slaing/events{/privacy}","received_events_url":"https://api.github.com/users/sl-slaing/received_events","type":"User","site_admin":false},"assignees":[{"login":"sl-slaing","id":44162572,"node_id":"MDQ6VXNlcjQ0MTYyNTcy","avatar_url":"https://avatars3.githubusercontent.com/u/44162572?v=4","gravatar_id":"","url":"https://api.github.com/users/sl-slaing","html_url":"https://github.com/sl-slaing","followers_url":"https://api.github.com/users/sl-slaing/followers","following_url":"https://api.github.com/users/sl-slaing/following{/other_user}","gists_url":"https://api.github.com/users/sl-slaing/gists{/gist_id}","starred_url":"https://api.github.com/users/sl-slaing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sl-slaing/subscriptions","organizations_url":"https://api.github.com/users/sl-slaing/orgs","repos_url":"https://api.github.com/users/sl-slaing/repos","events_url":"https://api.github.com/users/sl-slaing/events{/privacy}","received_events_url":"https://api.github.com/users/sl-slaing/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-12-14T13:40:59Z","updated_at":"2018-12-31T13:39:35Z","closed_at":"2018-12-31T13:39:34Z","author_association":"CONTRIBUTOR","body":"## Bug Report\r\nAn if statement was run that included an else ofType = numeric. It was expected that all numeric options for the field (from the set specified) would be created, however some were not.\r\n\r\n> Scenario: Running an if request that contains a non contradictory ofType constraint within its else statement should be successful\r\n>      Given the following fields exist:\r\n>        | foo |\r\n>        | bar |\r\n>        And foo is in set:\r\n>          | 1   |\r\n>          | 2   |\r\n>          | \"a\" |\r\n>          | \"b\" |\r\n>        And bar is in set:\r\n>          | 10   |\r\n>          | 20   |\r\n>          | \"AA\" |\r\n>          | \"BB\" |\r\n>        And there is a constraint:\r\n>        \"\"\"\r\n>          {\r\n>          \"if\": { \"field\": \"foo\", \"is\": \"equalTo\", \"value\": \"a\" },\r\n>          \"then\": { \"field\": \"bar\", \"is\": \"equalTo\", \"value\": \"AA\" },\r\n>          \"else\": { \"field\": \"bar\", \"is\": \"ofType\", \"value\": \"numeric\" }\r\n>          }\r\n>        \"\"\"\r\n>      Then the following data should be generated:\r\n>        | foo | bar  |\r\n>        | 1   | 10   |\r\n>        | 1   | 20   |\r\n>        | 2   | 10   |\r\n>        | 2   | 20   |\r\n>        | \"a\" | \"AA\" |\r\n>        | \"b\" | 10   |\r\n>        | \"b\" | 20   |\r\n\r\n### Steps to Reproduce:\r\n 1. Create a test as per the above that includes an if statement with an else ofType condition (or run the if.feature test file).\r\n2. See that the test (or **Scenario: Running an if request that contains a non contradictory ofType constraint within its else statement should be successful**) fails\r\n3. Check the error message to see that not all available combinations were created.\r\n\r\n### Expected Result:\r\nIn full data generation strategy mode all combinations of fields should be created as per the expected outcome of the test above.\r\n\r\n### Actual Result:\r\nThe test fails with an error indicating that some possible values that meet the constraints were not generated:\r\n\r\n> java.lang.AssertionError: \r\n> Expected: [1, 10], [1, 20], [2, 10], [2, 20], [a, AA], [b, 10], [b, 20]\r\n>      but: [1, 20], [1, 10], [2, 20], [b, 20], [a, AA]\r\n>  missing: [2, 10], [b, 10]\r\n>   counts: expected 7, but got 5\r\n\r\n### Environment:\r\nifTestsUpdated branch running in full generation strategy on IntelliJ.\r\n\r\n### Additional Context:\r\n![image](https://user-images.githubusercontent.com/43746958/50006508-db602c80-ffa5-11e8-843e-c4483de20bd9.png)\r\n\r\n"}}
{"actor":{"display_login":"cakehurstryan"}}