-
Notifications
You must be signed in to change notification settings - Fork 570
Move tests in js package to tests package. #792
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
Comments
Because a package consists of normal .go files and _test.go files. I embedded the entire package, because any other approach would be more complicated. I got this idea after I made #787. The goal there was to fix the vendoring issue. I can give this a try, if it goes smoothly, we can get this done before #787. But there isn't a reason this must be done before. |
This way, all GopherJS-specific tests are in tests package, rather than having an arbitrary split. None of the package js tests were internal to the package. This helps a future change where the js package becomes embedded into the compiler. It makes it easier to add and modify GopherJS tests without having to regenerate the js package. Resolves #792.
Not seeing any surprises with them move so far. Sent #800. |
Is it not just a case of excluding The issue with #800 is that the Is that not possible? |
Many tests in
That does not seem better to me. It would mean that a single import path can refer to different things depending on whether it's being used as a test package or as a normal Go package. It's complex conceptually, and the implementation becomes more complex too. |
Right, I think I can see where that complexity comes in. I wonder, is there an alternative here that gets us the best of both worlds? If we have a flag to Would this work? |
We already have that, except it's a build tag. It's This is documented at https://github.com/gopherjs/gopherjs/wiki/Developer-Guidelines#code-generation. I've considered that and it doesn't change the situation. I still think it's better to make |
Uh oh!
There was an error while loading. Please reload this page.
After PR #787 lands, the
js
andnosync
packages will be considered "core" and embedded into the GopherJS compiler viacompiler/gopherjspkg
package.gopherjspkg
needs to be regenerated wheneverjs
ornosync
changes (not often).To make everything work, I embedded the entire
js
,nosync
packages, including their tests, and did c964bad to make their tests run.When reviewing #779, I've realized we might want to modify/add tests in
js
package more often. Having to regenerategopherjspkg
is inconvenient (e.g., especially so when in the process of writing/modifying a test). It also increases the size of the compiler, and I don't want to feel pressure to keep the tests smaller because of that.Finally, there's always been an odd split of tests in
js
package and tests intests
package. Sometimes it's not clear where to add a test.By moving
js
tests fromjs
package intotests
, all these problems are resolved.All of
js
tests are external, so I think its should be easy. I think it's better than trying to makejs
normal package embedded but its tests not embedded.I think a good way of thinking
github.com/gopherjs/gopherjs/js
package (after #787) is that it's somewhat likeC
pseudo-package (related tocgo
), and it wouldn't make sense to try to put tests insideC
.The text was updated successfully, but these errors were encountered: