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

Revert jest tests config to use babel #1319

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

ps48
Copy link
Member

@ps48 ps48 commented Dec 21, 2023

Description

Revert to jest tests to using babel. This PR aligns with the long term solution mentioned in the below issue.
This PR removes ts-jest dependency and aligns with all other dashboards plugins to use babel for transform.

NOTE: Some jest tests or integrations were failing after the migration. Ideally should have been caught by ts-jest earlier. cc: @Swiddis

Issues Resolved

#1306

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

ps48 added 3 commits December 20, 2023 17:25
Signed-off-by: Shenoy Pratik <[email protected]>
Signed-off-by: Shenoy Pratik <[email protected]>
Copy link

codecov bot commented Dec 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f31d969) 57.42% compared to head (a0990a0) 51.58%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1319      +/-   ##
==========================================
- Coverage   57.42%   51.58%   -5.84%     
==========================================
  Files         330      305      -25     
  Lines       12091    10644    -1447     
  Branches     2792     2790       -2     
==========================================
- Hits         6943     5491    -1452     
- Misses       5102     5107       +5     
  Partials       46       46              
Flag Coverage Δ
dashboards-observability 51.58% <ø> (-5.84%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ps48 ps48 changed the title Revert to jest tests to using babel Revert jest tests config to use babel Dec 21, 2023
@ps48 ps48 marked this pull request as ready for review December 21, 2023 17:47
// Alternative to install them locally in node_modules
module.exports = function (api) {
// ensure env is test so that this config won't impact build or dev server
if (api.env('test')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't check but is babel config not needed for either build or dev?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely used only in a testing environment (Jest) to ensure that the Babel configuration for tests is applied. I guess for bootstrap/build OSD scripts takes care of it.

@ps48 ps48 merged commit 172faa2 into opensearch-project:main Dec 21, 2023
9 of 18 checks passed
ps48 added a commit that referenced this pull request Dec 21, 2023
* update jest config to use babel instead of ts-jest

Signed-off-by: Shenoy Pratik <[email protected]>
(cherry picked from commit a262aaf)

* remove ts-jest package

Signed-off-by: Shenoy Pratik <[email protected]>
(cherry picked from commit 66d5621)

* update yarn.lock file

Signed-off-by: Shenoy Pratik <[email protected]>

* update snapshots

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Shenoy Pratik <[email protected]>
mengweieric pushed a commit to mengweieric/dashboards-observability that referenced this pull request Dec 22, 2023
…ect#1319) (opensearch-project#1320)

* update jest config to use babel instead of ts-jest

Signed-off-by: Shenoy Pratik <[email protected]>
(cherry picked from commit a262aaf)

* remove ts-jest package

Signed-off-by: Shenoy Pratik <[email protected]>
(cherry picked from commit 66d5621)

* update yarn.lock file

Signed-off-by: Shenoy Pratik <[email protected]>

* update snapshots

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Shenoy Pratik <[email protected]>
amsiglan pushed a commit to amsiglan/dashboards-observability that referenced this pull request Jun 7, 2024
…ect#1319) (opensearch-project#1320)

* update jest config to use babel instead of ts-jest

Signed-off-by: Shenoy Pratik <[email protected]>
(cherry picked from commit a262aaf)

* remove ts-jest package

Signed-off-by: Shenoy Pratik <[email protected]>
(cherry picked from commit 66d5621)

* update yarn.lock file

Signed-off-by: Shenoy Pratik <[email protected]>

* update snapshots

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Shenoy Pratik <[email protected]>
(cherry picked from commit 2c969e3)
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

Successfully merging this pull request may close these issues.

4 participants