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

Move core query builder logic out to @finos/legend-query-builder and cleanup Jest test idiomatic usages #1476

Merged
merged 11 commits into from Sep 14, 2022

Conversation

akphi
Copy link
Contributor

@akphi akphi commented Sep 12, 2022

Summary

  • bump dependencies
  • Change usage of .mockResolvedValue(...) to .mockReturnValue(Promise.resolve(...)): Strangely, this has to do with Jest.mockResolvedValue(...) not creating the same Promise as Node.Promise, for contexts, see:
    [Bug]: "mockImplementation" is behaving different than the syntacical-sugar version"mockResolvedValue" jestjs/jest#13206
    mockResolvedValue / mockRejectedValue should returns a real Promise jestjs/jest#6645
    Jest globals differ from Node globals jestjs/jest#2549
    Evaluate node core modules within a vm.Context nodejs/node#31852
  • Remove usage of MOBX__enableSpyOrMock, and MOBX__disableSpyOrMock: these were seemingly only useful against the bugs: Mobx 6.1 breaks spying on actions in unit test mobxjs/mobx#2752 when we were doing flow(... some arrow function...) pattern, now we have moved to use makeObservable, things seem fine. See the note for these here:

    MobX makes some fields non-configurable or non-writable to prevent you from doing things that are not supported or would most likely break your code. However this can also prevent spying/mocking/stubbing in your tests. configure({ safeDescriptors: false }) disables this safety measure, making everything configurable and writable. Note it doesn't affect existing observables, only the ones created after it's been configured. Use with caution and only when needed - do not turn this off globally for all tests, otherwise you risk false positives (passing tests with broken code)

  • Add meta::pure::functions::date::Time and meta::pure::functions::date::Duration to core system
  • Move DndProvider to LegendApplicationComponentFrameworkProvider
  • BREAKING CHANGE: Remove @finos/legend-extension-application-studio-management-toolkit - make sure to document this somewhere
  • BREAKING CHANGE: Move core query builder logic out from @finos/legend-application-query to @finos/legend-query-builder:
    • Remove @finos/legend-extension-application-studio-query-builder plugin
    • Document and write changesets regarding this change

How did you test this change?

  • Test(s) added
  • Manual testing (please provide screenshots/recordings)
  • No testing (please provide an explanation)

@changeset-bot
Copy link

changeset-bot bot commented Sep 12, 2022

🦋 Changeset detected

Latest commit: 6639410

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@finos/legend-application-studio Major
@finos/legend-extension-dsl-data-space Patch
@finos/legend-extension-dsl-diagram Major
@finos/legend-extension-dsl-mastery Patch
@finos/legend-extension-dsl-persistence Patch
@finos/legend-extension-dsl-text Patch
@finos/legend-extension-external-store-service Patch
@finos/babel-preset-legend-studio Patch
@finos/eslint-plugin-legend-studio Patch
@finos/legend-application Minor
@finos/legend-application-query Major
@finos/legend-application-query-bootstrap Patch
@finos/legend-application-query-deployment Patch
@finos/legend-application-studio-bootstrap Patch
@finos/legend-application-studio-deployment Patch
@finos/legend-application-taxonomy Patch
@finos/legend-application-taxonomy-bootstrap Patch
@finos/legend-application-taxonomy-deployment Patch
@finos/legend-art Patch
@finos/legend-dev-utils Patch
@finos/legend-extension-dsl-persistence-cloud Patch
@finos/legend-extension-external-format-json-schema Patch
@finos/legend-extension-external-language-morphir Patch
@finos/legend-extension-tracer-zipkin Patch
@finos/legend-graph Major
@finos/legend-query-builder Patch
@finos/legend-server-depot Patch
@finos/legend-server-sdlc Patch
@finos/legend-shared Patch
@finos/legend-storage Patch
@finos/stylelint-config-legend-studio Patch
@finos/legend-manual-tests Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@finos-cla-bot finos-cla-bot bot added the cla-present CLA Signed label Sep 12, 2022
@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #1476 (6639410) into master (7d600e3) will increase coverage by 0.61%.
The diff coverage is 49.30%.

@@            Coverage Diff             @@
##           master    #1476      +/-   ##
==========================================
+ Coverage   40.57%   41.18%   +0.61%     
==========================================
  Files        1230     1227       -3     
  Lines       54259    54182      -77     
  Branches    12283    12264      -19     
==========================================
+ Hits        22013    22315     +302     
+ Misses      32169    31782     -387     
- Partials       77       85       +8     
Impacted Files Coverage Δ
...-application-query/src/application/LegendQuery.tsx 0.00% <0.00%> (ø)
...y/src/components/QueryEditorComponentTestUtils.tsx 5.55% <ø> (-94.45%) ⬇️
...n-query/src/stores/LegendQueryApplicationPlugin.ts 0.00% <ø> (ø)
...d-application-query/src/stores/QueryEditorStore.ts 4.09% <0.00%> (-21.35%) ⬇️
...nd-application-query/src/stores/QuerySetupStore.ts 3.52% <ø> (ø)
.../legend-application-studio-bootstrap/src/index.tsx 0.00% <ø> (ø)
...pplication-studio/src/application/LegendStudio.tsx 0.00% <0.00%> (ø)
...tudio/src/application/LegendStudioPluginManager.ts 80.95% <ø> (+19.04%) ⬆️
...SLExternalFormat_LegendStudioApplicationPlugin.tsx 17.03% <0.00%> (ø)
...studio/src/components/EditorComponentTestUtils.tsx 100.00% <ø> (ø)
... and 197 more

@akphi akphi marked this pull request as ready for review September 14, 2022 19:51
@akphi akphi changed the title minor cleanups Move core query builder logic out to @finos/legend-query-builder and cleanup Jest test idiomatic usages Sep 14, 2022
@akphi akphi merged commit 293f234 into finos:master Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-present CLA Signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants