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

Tests files should not be compiled with the theia code #536

Closed
hexa00 opened this issue Sep 21, 2017 · 14 comments
Closed

Tests files should not be compiled with the theia code #536

hexa00 opened this issue Sep 21, 2017 · 14 comments
Labels
test issues related to unit and api tests

Comments

@hexa00
Copy link

hexa00 commented Sep 21, 2017

I think test files should be compiled only before the tests runs.

This would also allow tests that may depend on previously compiled code in the same package. Like the globalize PR needs to do.

Objections?

@svenefftinge
Copy link
Contributor

I don't understand this request.
Do you want to recompile the code base before every test? Or what are test files?

@hexa00
Copy link
Author

hexa00 commented Sep 21, 2017

I mean we should not compile *.spec.ts when we compile theia with yarn.build
And rather compile spec.ts as we do yarn test

@svenefftinge
Copy link
Contributor

Ok, why?

@hexa00
Copy link
Author

hexa00 commented Sep 21, 2017

In the case of the globalize PR you have like:

test.spec.ts
require(localize.ts);

generator.ts
fs.write(localize.ts)

And this package would be built with:
generate-localize.ts && build

So since the test requires localize.ts and that this is a generated file by the package it fails to compile.

We would need to compile the package, run the generator, then compile the test.

@hexa00
Copy link
Author

hexa00 commented Sep 21, 2017

I think also it will save time when we package theia, we don't need to build the tests then..

@svenefftinge
Copy link
Contributor

why do we need to compile it first? I think it should be "generate, compile, test".

@hexa00
Copy link
Author

hexa00 commented Sep 22, 2017

Well the generator needs to be compiled...

@svenefftinge
Copy link
Contributor

Ah, ok I didn't realize it is part of the runtime code. The generator should be in a separate package, actually being moved to dev-packages after #527 was merged. We should also have a CLI command for it.

@hexa00
Copy link
Author

hexa00 commented Sep 22, 2017

The problem in this case is that an extension dev may require that generator so it needs to be part of a proper package I think ? So it can be published etc ?

@svenefftinge
Copy link
Contributor

Yes, that is the case with all our dev dependencies. And the cli exposes the tools to extension developers.

@hexa00
Copy link
Author

hexa00 commented Sep 22, 2017

OK So the dev-deps will be published ?

@svenefftinge
Copy link
Contributor

Yes. Extension developers (and Theia packaging jobs) will pull the tools from npm.js.

@hexa00
Copy link
Author

hexa00 commented Sep 22, 2017

OK great then! :) We'll move it there

@vince-fugnitto
Copy link
Member

I believe the issue can be successfully closed, most dev packages are published (except for `ext-scripts). Please feel free to re-open the issue if the issue is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test issues related to unit and api tests
Projects
None yet
Development

No branches or pull requests

3 participants