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

[FW][FIX] config: Avoid compiling test files #1321

Closed

Conversation

fw-bot
Copy link
Collaborator

@fw-bot fw-bot commented Apr 29, 2022

Description:

Currently, when running a build:* script, we compile both src and
test files from TS to JS.
There is no need to compile the test files as the step is only useful to
utlimately rollup the src files.
Furthermore, the test files (and src) are recompiled by jest when
running the tests.

Benchmark

before : rm -r dist && time mpm run build:js
real 0m8.321s
user 0m15.928s
sys 0m0.290s

after : rm -r dist && time npm run build:js
real 0m5.563s
user 0m11.454s
sys 0m0.176s


[FIX] config: Feed dedicated tsconfig.json file to jest
Since 457fe70, we changed stopped compiling the .ts files in the
tests folders to save compilation time. Unfortunately, jest was using
the very same file to compile (via ts-jest) and it actually needs to
compile tests/setup/jest.setup.ts to work properly.

This commit introduces a new dedicated tsconfig file for ts-jest in
order to retain the improvements of 457fe70.

description of this task, what is implemented and why it is implemented that way.

Odoo task ID : TASK_ID

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_lt("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

Forward-Port-Of: #1319

Currently, when running a `build:*` script, we compile both src and
test files from TS to JS.
There is no need to compile the test files as the step is only useful to
utlimately rollup the `src` files.
Furthermore, the test files (and src) are recompiled by jest when
running the tests.

Benchmark
---------

before : `rm -r dist && time mpm run build:js`
real    0m8.321s
user    0m15.928s
sys     0m0.290s

after : `rm -r  dist && time npm run build:js`
real    0m5.563s
user    0m11.454s
sys     0m0.176s

closes #1313

X-original-commit: 3b02f76
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Since 457fe70, we changed stopped compiling the `.ts` files in the
`tests` folders to save compilation time. Unfortunately, jest was using
the very same file to compile (via `ts-jest`) and it actually needs to
compile `tests/setup/jest.setup.ts` to work properly.

This commit introduces a new dedicated `tsconfig` file for ts-jest in
order to retain the improvements of 457fe70.

closes #1317

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
X-original-commit: dd3bc96
@robodoo
Copy link
Collaborator

robodoo commented Apr 29, 2022

@fw-bot
Copy link
Collaborator Author

fw-bot commented Apr 29, 2022

This PR targets saas-15.3 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

robodoo pushed a commit that referenced this pull request Apr 29, 2022
Currently, when running a `build:*` script, we compile both src and
test files from TS to JS.
There is no need to compile the test files as the step is only useful to
utlimately rollup the `src` files.
Furthermore, the test files (and src) are recompiled by jest when
running the tests.

Benchmark
---------

before : `rm -r dist && time mpm run build:js`
real    0m8.321s
user    0m15.928s
sys     0m0.290s

after : `rm -r  dist && time npm run build:js`
real    0m5.563s
user    0m11.454s
sys     0m0.176s

closes #1313

X-original-commit: 3b02f76
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Part-of: #1321
robodoo pushed a commit that referenced this pull request Apr 29, 2022
Since 457fe70, we changed stopped compiling the `.ts` files in the
`tests` folders to save compilation time. Unfortunately, jest was using
the very same file to compile (via `ts-jest`) and it actually needs to
compile `tests/setup/jest.setup.ts` to work properly.

This commit introduces a new dedicated `tsconfig` file for ts-jest in
order to retain the improvements of 457fe70.

closes #1317

closes #1321

X-original-commit: dd3bc96
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
@robodoo robodoo closed this Apr 29, 2022
@robodoo robodoo temporarily deployed to merge April 29, 2022 12:24 Inactive
@fw-bot fw-bot deleted the saas-15.3-saas-15.1-avoid-compile-tests-rar-plAK-fw branch May 13, 2022 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants