Skip to content

Conversation

gregschohn
Copy link
Collaborator

Move javascript transformation files into their own gradle package, define some jest tests, and pull them into the resources of the json transformer jar file to keep everything on the java side consistent with what it had been doing.

Testing

gradle tests

Check List

  • New functionality includes testing
  • Public documentation issue/PR created, if applicable.

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.

…efine some jest tests, and pull them

into the resources of the json transformer jar file to keep everything on the java side consistent with what it had been doing.

Signed-off-by: Greg Schohn <[email protected]>
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.38%. Comparing base (c438272) to head (db2beb9).
Report is 12 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1355      +/-   ##
============================================
- Coverage     79.42%   79.38%   -0.05%     
+ Complexity     3260     3258       -2     
============================================
  Files           468      468              
  Lines         16941    16941              
  Branches       1116     1116              
============================================
- Hits          13455    13448       -7     
- Misses         2810     2817       +7     
  Partials        676      676              
Flag Coverage Δ
unittests 79.38% <ø> (-0.05%) ⬇️

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.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

Nice! And thanks for driving use of the npm plugin for gradle that will come in handy in the near future for the website.

Lets see about integrated these tests into the CI before merging, see that comment thread for more details.

# Conflicts:
#	transformation/transformationPlugins/jsonMessageTransformers/jsonJSTransformer/build.gradle
…ply to the standardJavascriptTransforms project.

Only apply the 'java' plugin to projects in the repo that need it - or more specifically, that were using it before (which was all).
Only the standardJavascriptTransforms project should not have it at the moment, though we probably want to remove it elsewhere, like in the docker solution.

Signed-off-by: Greg Schohn <[email protected]>
@gregschohn gregschohn force-pushed the JavascriptGradlePackage branch from 34c4924 to b290d62 Compare March 22, 2025 19:01
Signed-off-by: Greg Schohn <[email protected]>

# Conflicts:
#	awsUtilities/build.gradle
#	build.gradle
#	transformation/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformer/build.gradle
#	transformation/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/build.gradle
#	transformation/transformationPlugins/jsonMessageTransformers/jsonJSTransformerProvider/build.gradle
#	transformation/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformer/build.gradle
#	transformation/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/build.gradle
#	transformation/transformationPlugins/jsonMessageTransformers/jsonTypeMappingsSanitizationTransformer/build.gradle
#	transformation/transformationPlugins/jsonMessageTransformers/jsonTypeMappingsSanitizationTransformerProvider/build.gradle
…ing all the tests.

To fix jacoco, I just applied it at the top-level, which (hopefully) doesn't seem to have an impact on the javascript project's ability to build successfully.

Signed-off-by: Greg Schohn <[email protected]>
…commit) and reverting another file build file that shouldn't need any changes

Signed-off-by: Greg Schohn <[email protected]>
They were already part of tests, but allTests did a filter ONLY for JUnit tests before.  Now it also picks up tasks named 'test' too.

Signed-off-by: Greg Schohn <[email protected]>
Signed-off-by: Greg Schohn <[email protected]>

# Conflicts:
#	build.gradle
@peternied peternied merged commit f3f73be into opensearch-project:main Apr 17, 2025
57 checks passed
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.

2 participants