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

Longer output with viewSeed #532

Open
ashawley opened this issue Sep 1, 2019 · 1 comment
Open

Longer output with viewSeed #532

ashawley opened this issue Sep 1, 2019 · 1 comment

Comments

@ashawley
Copy link
Contributor

ashawley commented Sep 1, 2019

Toying around with the ScalaCheck latest in downstream projects, the new default of showing the failed seed may not scale well.

This is especially the case with law checking libraries that might be running multiple ScalaCheck properties as part of a single law. When you make a small change that breaks a bunch of laws, you could get a wall of text about the initial seeds.

Maybe it's not a big deal, but failures with law checking wasn't a situation I had considered for showing the failing seed.

Here's an example from kittens:
> coreJVM/testOnly cats.derived.PartialOrderSuite
failing seed for partialOrder.antisymmetry is lf2ypg1joEGClxrKWk4j-9oJUEfyQwkmwJtTXj8ZRHO=
failing seed for partialOrder.antisymmetry is c7mkrhIFD4W4oFXvDbJIbmkZPSrcG5bBcCUDTzflOAO=
failing seed for partialOrder.gt is Q41VLcdfzI97Z4DLNoCX3x5Vp2jbUU3SNrV1THxK6TA=
failing seed for partialOrder.gt is SQml23x0v1nqC4T9-RjRSR03xVt13aw7mtaZebQcJmL=
failing seed for partialOrder.gteqv is 6S8ZxWzBL7DmnMvYp5Zq92xkxzxUEjjCmfa--FaRC2F=
failing seed for partialOrder.gteqv is a30a_3MqhvZMtbEdT_WEAVXBbbeIm734wIZN0vetNPA=
failing seed for partialOrder.lt is 4VU3Tr8afvMBpHxUxUoSRtZAI27zIAuQLqi11s3tvhP=
failing seed for partialOrder.lt is 2eRxRp2cYZbB06JtKA1D0mx54pZF0qYnXbXqcbCCl4B=
failing seed for partialOrder.partialCompare is 4NNGgYj9mySeWhA2TF3dTpw7rzhHyZdnDwIUxJUVaDI=
failing seed for partialOrder.partialCompare is F17m2MWc0905Tf1CEgWZX1akFo1NdnEXeOBNPc4nRQL=
failing seed for partialOrder.pmax is ADwFiaTP73sBZepGxdb3piLfmT0uLvOU8A3DcSXp0_H=
failing seed for partialOrder.pmax is i0_vEMI_QKUq6edVpXkK6xg32GwK-P5DdWMeTTpKdML=
failing seed for partialOrder.pmin is 2EzX11vc_k5Q6Oh2jXNvRxnr9Msaf-RhpMaWhyd9XmG=
failing seed for partialOrder.pmin is dx3AtYGlGFtubrPq-hkEw9gfKIaRAaqtsmCAFeMZRKK=
failing seed for partialOrder.reflexivity is FFVzLYBPbBVBSDbf5FlDB3Wx8gyGHBg45qjuDiWgFsD=
failing seed for partialOrder.reflexivity is fA72aXoXHMR8SJDBUWjt5ZFdrlqhxijxFSKhtzDaHfB=
failing seed for partialOrder.reflexivity gt is 8HPIqwSuP81ju-nGwLfHKbheNEnbdn2u8SwQ-2KadfK=
failing seed for partialOrder.reflexivity gt is oZakIsiW_D5x-cHGuiRwIedi1MW8UIuXkNUHu5hF6-F=
failing seed for partialOrder.reflexivity lt is GQ0EddjlaXXRqZC8cVW4gMqEJH2vDSX8V2szjQbmN9D=
failing seed for partialOrder.reflexivity lt is XKFhUXv-sIJ5RQD8xuOM3mqXu7ZqaI_uaw3mk2twrWJ=
failing seed for partialOrder.symmetry is Ht6ubC2CINg5mgZpBO-n4fYiACPejk9FHphVhevGFXL=
failing seed for partialOrder.symmetry is hqrHkSd0gHIJ8Uqx-RjLiEX99elQxLvGc1iel5AMseK=
failing seed for partialOrder.transitivity is L74iiT4udX3slsC929wHaLg2Q-el5Rghim5B88oVrQP=
failing seed for partialOrder.transitivity is jaQn1P5vPORwH-PDnzK0KcErHt_FbsO717UIhok9buB=
failing seed for partialOrder.antisymmetry is xv70SWKLLM7cEQi2dKIMyBMHyimXpU9bGChKdouh8DG=
failing seed for partialOrder.antisymmetry is 9-JogY0S9Bl5MujbGePF_D8ZDn2ZmNElMKqjdDIDABE=
failing seed for partialOrder.gt is wI5qGP9L7u0tyf3J7gAl1RjY4FETWd_GZDmZXKM0ZlA=
failing seed for partialOrder.gt is XtAL5H_gk6hOQ5TJ_8GicRt7Evkv6WDlv9qERAZ2LDJ=
failing seed for partialOrder.gteqv is alSfXkeaozNdep-TeCWWlCQ0UQl9ZlwwY4ODFEOpf8L=
failing seed for partialOrder.gteqv is SX21KxCgzDKkVY4Ac8WjRv6leWyZnUxx4CpfULQW58P=
failing seed for partialOrder.lt is HkwxWOhe-ErFt38EUrCPa_6xe9sCDP5pgwMqtbjFAHH=
failing seed for partialOrder.lt is hU661AvSXp6u_iv8zQLe6uzhPLjIPGAhF34rVUa5N0O=
failing seed for partialOrder.partialCompare is Ff8cJeMKDoegC5BjHTXBlWUFu5-yZIqJWANAqi8D9EO=
failing seed for partialOrder.partialCompare is DKpE-IoL6rfsmJEEw1yLsMq7nqpVxjVNCcIu_PQLf-H=
failing seed for partialOrder.pmax is zhl-tibPtTWuq67J9OepTFwl8WECXImSGJubtT_MolF=
failing seed for partialOrder.pmax is WGXzbMWrP_0-SckM5SiL9gjH22cDrVb_U1a4PZ6bEwD=
failing seed for partialOrder.pmin is yE0qe9vNS24oGAQfb4W2uhKggSRb5vJGFC9kldDXWBE=
failing seed for partialOrder.pmin is p7LMnUXlr7cUVF5xRH3Vko_nOKeyVh5HoNC48cE8PhN=
failing seed for partialOrder.reflexivity is O_UHiPPz0td0AcKiBiVr-2hx0ruaipYVDylwHZBJztL=
failing seed for partialOrder.reflexivity is t9IdQZZCM12ySl3FP4k34rUy6fDs7M6ItRO4CFIgg8P=
failing seed for partialOrder.reflexivity gt is wifXJIpRBefBZ9OUhUbelElFwH4vb4xj4nFJ8o775yH=
failing seed for partialOrder.reflexivity gt is -UeCM5T-I3QUwe7RUdb7dXGchassdRh_B5VVphuD0WF=
failing seed for partialOrder.reflexivity lt is 9BcflNJVr6t8qX0kfFBxMafA2UTNyAGP8KXy4UcYRVP=
failing seed for partialOrder.reflexivity lt is _onMVG4e7CThfD5_QZBkQqpiG69A4xQB5qhZAc6zBZE=
failing seed for partialOrder.symmetry is ZnzG3_RftoNYx7ZbylfhOifSvp0eoIvh8yG6o5ug6tN=
failing seed for partialOrder.symmetry is lM6QiIfHYjNC8eRJTM-FE2F6veZVc9vfyDVhPe4Mc4J=
failing seed for partialOrder.transitivity is td6w2JqDhb8QtiDZQ6q4ROrmW_Hq8dNRGCUIphvsueK=
failing seed for partialOrder.transitivity is kbdodbAqc5TFKUw7u-oeMZfdD0gljfTtRBXpRVrCP_A=
failing seed for partialOrder.antisymmetry is qwpmcSY5sw557VDfi1Na7rdhgBSpf_vE1p8myWtn1SE=
failing seed for partialOrder.antisymmetry is gTTEX4IEJC7yCfv_pceNm24bR5o4MwpF7U2e9EsoIGK=
failing seed for partialOrder.gt is FQGs162XU64C4slXTJ_Os9C-M83HXX9pQOvsojcxf4F=
failing seed for partialOrder.gt is VPB_ZfDnoXosrQk2yky_a73C0TXc9RNEAjMzH6aAqWO=
failing seed for partialOrder.gteqv is qYGwa6BEVN94HdxtF2uBbmI3Es4CrzWL5Vyr5s9MGoO=
failing seed for partialOrder.gteqv is PQhfgDa8WzQXC6sP1UUZaiYznU8P-aaxRXEC1687TxF=
failing seed for partialOrder.lt is rzO2Bh2pvrsA8X13dWObw-iWh3O772DK19oRRfwcK4K=
failing seed for partialOrder.lt is MJAhyfCCBjY7eBKIBp0j7HaFglHuDMiuDXSjeGpWPHM=
failing seed for partialOrder.partialCompare is LANNswgrEt2aDHj8dGAeIiD9DKSv0exgyDj-cYZNZYL=
failing seed for partialOrder.partialCompare is zeKjh_vFBGCHmUtdOQq36LvvI9mzAjaAGZGqQOj_xmB=
failing seed for partialOrder.pmax is nk2VoD6_VN809EMo6u5QnMj6zkGozE3NPVKVsElXAgP=
failing seed for partialOrder.pmax is TxRcNczShy700_C5VZ3nDvPX1lYRiwZXXC12Ut6UIXN=
failing seed for partialOrder.pmin is Ap3SnOLftq42rZBzTTxnZM5q1buWYpS8P0sH3_JVveG=
failing seed for partialOrder.pmin is y9FgdZ67Y6RwPI39APd3bpQPcgIjXHPPRBqjXvMigbP=
failing seed for partialOrder.reflexivity is qHBxCAeX6KbIBOiF56PDAJEqWIgyOkd-qvMkPVqLAKO=
failing seed for partialOrder.reflexivity is iVbFODiCVlL-cl5lCLkZM7M77vsisD8qMuLDQk8IEuJ=
failing seed for partialOrder.reflexivity gt is 0xbWPy9ktwEFpyT4fLHqnYKiSh0hNIFWORd6yFpw8TH=
failing seed for partialOrder.reflexivity gt is QnhxmBIdFDcWFqiru9cRlbqFmXSlVhWIshs50AQhVHC=
failing seed for partialOrder.reflexivity lt is h4ABM57FyxUHNxVdtWjBJM58gphxuQO44a6ZhLe4stN=
failing seed for partialOrder.reflexivity lt is 7awAre7RuP0GUfURzLq7LGKo35ZBFROZ7_vNgBlXvyI=
failing seed for partialOrder.symmetry is OfpkKHn3iR4x0_JRoc5rWYs4ZWSkLsHa5MrE1e1xsfA=
failing seed for partialOrder.symmetry is 5r31qr2phll1Stu1_vnkabdjFV_StlKxaDeLtoJAutM=
failing seed for partialOrder.transitivity is 31_n_Co4fsy3FSAthESeRoY8d-zsgrveoXpZ9La13eB=
failing seed for partialOrder.transitivity is 0AKP-rvcX8DVnIKDl9AeIjFsgPrcvLkebNqN8cJtgoL=
[info] PartialOrderSuite:
[info] - auto.PartialOrder[IList[Int]].partialOrder.antisymmetry
[info] - auto.PartialOrder[IList[Int]].partialOrder.gt
[info] - auto.PartialOrder[IList[Int]].partialOrder.gteqv
[info] - auto.PartialOrder[IList[Int]].partialOrder.lt
[info] - auto.PartialOrder[IList[Int]].partialOrder.partialCompare
[info] - auto.PartialOrder[IList[Int]].partialOrder.pmax
[info] - auto.PartialOrder[IList[Int]].partialOrder.pmin
[info] - auto.PartialOrder[IList[Int]].partialOrder.reflexivity
[info] - auto.PartialOrder[IList[Int]].partialOrder.reflexivity gt
[info] - auto.PartialOrder[IList[Int]].partialOrder.reflexivity lt
[info] - auto.PartialOrder[IList[Int]].partialOrder.symmetry
[info] - auto.PartialOrder[IList[Int]].partialOrder.transitivity
[info] - auto.PartialOrder[Inner].partialOrder.antisymmetry
[info] - auto.PartialOrder[Inner].partialOrder.gt
[info] - auto.PartialOrder[Inner].partialOrder.gteqv
[info] - auto.PartialOrder[Inner].partialOrder.lt
[info] - auto.PartialOrder[Inner].partialOrder.partialCompare
[info] - auto.PartialOrder[Inner].partialOrder.pmax
[info] - auto.PartialOrder[Inner].partialOrder.pmin
[info] - auto.PartialOrder[Inner].partialOrder.reflexivity
[info] - auto.PartialOrder[Inner].partialOrder.reflexivity gt
[info] - auto.PartialOrder[Inner].partialOrder.reflexivity lt
[info] - auto.PartialOrder[Inner].partialOrder.symmetry
[info] - auto.PartialOrder[Inner].partialOrder.transitivity
[info] - auto.PartialOrder[Outer].partialOrder.antisymmetry
[info] - auto.PartialOrder[Outer].partialOrder.gt
[info] - auto.PartialOrder[Outer].partialOrder.gteqv
[info] - auto.PartialOrder[Outer].partialOrder.lt
[info] - auto.PartialOrder[Outer].partialOrder.partialCompare
[info] - auto.PartialOrder[Outer].partialOrder.pmax
[info] - auto.PartialOrder[Outer].partialOrder.pmin
[info] - auto.PartialOrder[Outer].partialOrder.reflexivity
[info] - auto.PartialOrder[Outer].partialOrder.reflexivity gt
[info] - auto.PartialOrder[Outer].partialOrder.reflexivity lt
[info] - auto.PartialOrder[Outer].partialOrder.symmetry
[info] - auto.PartialOrder[Outer].partialOrder.transitivity
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.antisymmetry
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.gt
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.gteqv
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.lt
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.partialCompare
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.pmax
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.pmin
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.reflexivity
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.reflexivity gt
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.reflexivity lt
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.symmetry
[info] - auto.PartialOrder[Interleaved[Int]].partialOrder.transitivity
[info] - auto.PartialOrder[Tree[Int]].partialOrder.antisymmetry
[info] - auto.PartialOrder[Tree[Int]].partialOrder.gt
[info] - auto.PartialOrder[Tree[Int]].partialOrder.gteqv
[info] - auto.PartialOrder[Tree[Int]].partialOrder.lt
[info] - auto.PartialOrder[Tree[Int]].partialOrder.partialCompare
[info] - auto.PartialOrder[Tree[Int]].partialOrder.pmax
[info] - auto.PartialOrder[Tree[Int]].partialOrder.pmin
[info] - auto.PartialOrder[Tree[Int]].partialOrder.reflexivity
[info] - auto.PartialOrder[Tree[Int]].partialOrder.reflexivity gt
[info] - auto.PartialOrder[Tree[Int]].partialOrder.reflexivity lt
[info] - auto.PartialOrder[Tree[Int]].partialOrder.symmetry
[info] - auto.PartialOrder[Tree[Int]].partialOrder.transitivity
[info] - auto.PartialOrder[Recursive].partialOrder.antisymmetry *** FAILED ***
[info]   StackOverflowError was thrown during property evaluation.
[info]     Message: "None"
[info]     Occurred when passed generated values (
[info]   
[info]     )
[info]   org.scalatest.exceptions.GeneratorDrivenPropertyCheckFailedException:
[info]   at org.scalatestplus.scalacheck.CheckerAsserting$$anon$2.indicateFailure(CheckerAsserting.scala:251)
[info]   at org.scalatestplus.scalacheck.CheckerAsserting$$anon$2.indicateFailure(CheckerAsserting.scala:238)
[info]   at org.scalatestplus.scalacheck.UnitCheckerAsserting$CheckerAssertingImpl.check(CheckerAsserting.scala:160)
[info]   at org.scalatestplus.scalacheck.Checkers.check(Checkers.scala:371)
[info]   at org.scalatestplus.scalacheck.Checkers.check$(Checkers.scala:369)
[info]   at cats.derived.PartialOrderSuite.check(partialOrder.scala:24)
[info]   at org.typelevel.discipline.scalatest.Discipline.$anonfun$checkAll$3(Discipline.scala:12)
[info]   at org.typelevel.discipline.scalatest.Discipline$$Lambda$11133/1420058296.apply(Unknown Source)
@non
Copy link
Contributor

non commented Sep 1, 2019

Yeah. If we can't do a better job here, maybe we should also make this an argument (e.g. -viewFailingSeed)?

The issue is that the right thing to do would be to return the seed along with the failure (in the Result). This works but (1) would need to preserve compatibility with the previous code and (2) downstream libraries would definitely not be able to start using it for awhile.

It might be possible to just improve the printing code so it occurs "nearer" the other code the user sees. I'll try to take a look at this soon. Assuming that I can't figure out a better place to print, we should consider our other options.

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

2 participants