- Issue created by @fjgarlin
- ๐ช๐ธSpain fjgarlin
Ok, it took longer than expected but I tried to make it as solid as possible. The script regeneration works now much better.
The script has some configuration constants, that would not need changing unless the tests and fixtures change. I made comments were relevant and the script gives output on whether the fixture was saved or not. It also offers suggestions to change some old UUIDs for new ones if needed.
However, there are things that we should change for future tests writing regarding the fixtures.
- It doesnโt make sense to check whether we have 4564 results or 1897 results. We just one results, so we can change things for regex checks instead.
- When checking list of returned modules, the lists should be small rather than having 8-10 modules, as results can change.
- One of the tests checks for the newest modulesโฆ this will always change on regeneration.Right now the tests are falling due to expecting certain list of modules and certain number of results. It also needs rebasing and solving the conflict because of a commit that happened today.
- ๐ช๐ธSpain fjgarlin
This is finally ready to be checked. The re-generation is now fully automated, it offers suggestions on what to change in the tests and the tests are a bit less flaky, as we don't check an exact list of modules in certain order (that's already tested on other classes).
I insist that the followup ๐ Simplify tests for JsonApi plugin Active should be addressed anyway, as all we should be checking in the JsonApi plugin is that it is able to consume the jsonapi data and produce results. This can be a kernel or even unit test, but I'll let that be decided in the other issue.
As far as this go, I think it's ready.
- ๐ฎ๐ณIndia narendraR Jaipur, India
Regenerated fixture on local using
php scripts/regenerate-drupalorg-jsonapi-fixture.php
and run all tests inProjectBrowserUiTestJsonApi
. All tests are passing after fixture update.
Moving this issue to RTBC. - ๐บ๐ธUnited States chrisfromredfin Portland, Maine
Please just address the one comment. I'd love to understand why the JSON files are numbered. Either change them away from being numbered to something more self-documenting, or document the "why" for numerically-named files in the function's DocBlock / a code comment explaining why they are the way they are.
- ๐ช๐ธSpain fjgarlin
That's a good point. I was just keeping what was in there, I don't think there is the need for numbers anymore, especially with the new script that only takes "keys" and "values".
I'll change it.
- ๐บ๐ธUnited States chrisfromredfin Portland, Maine
Haven't updated where the fixture files are generated. :)
-
chrisfromredfin โ
committed fd257319 on 2.0.x authored by
fjgarlin โ
Issue #3489810 by fjgarlin, chrisfromredfin, narendrar: Improve fixture...
-
chrisfromredfin โ
committed fd257319 on 2.0.x authored by
fjgarlin โ
Automatically closed - issue fixed for 2 weeks with no activity.