Skip to content

[Feature/extensions] Restructured testExtensionsInitialize #4029

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

Conversation

ryanbogan
Copy link
Member

Signed-off-by: Ryan Bogan rbogan@amazon.com

Description

Fixes the gradle check failure for testExtensionsInitialize

Check List

  • [ X] New functionality includes testing.
    • [ X] All tests pass
  • [X ] 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.

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@ryanbogan ryanbogan requested review from a team and reta as code owners July 27, 2022 20:50
@ryanbogan ryanbogan changed the title Restructured testExtensionsInitialize [Feature/extensions] Restructured testExtensionsInitialize Jul 27, 2022
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2022

Codecov Report

Merging #4029 (c28ef7b) into feature/extensions (be1a605) will decrease coverage by 0.02%.
The diff coverage is 71.05%.

@@                   Coverage Diff                    @@
##             feature/extensions    #4029      +/-   ##
========================================================
- Coverage                 70.64%   70.61%   -0.03%     
- Complexity                56884    57000     +116     
========================================================
  Files                      4584     4597      +13     
  Lines                    273654   274339     +685     
  Branches                  40105    40187      +82     
========================================================
+ Hits                     193318   193729     +411     
- Misses                    64085    64339     +254     
- Partials                  16251    16271      +20     
Impacted Files Coverage Δ
...rg/opensearch/client/ClusterRequestConverters.java 44.28% <0.00%> (ø)
...h/client/indices/GetComponentTemplatesRequest.java 0.00% <0.00%> (ø)
...ent/indices/GetComposableIndexTemplateRequest.java 0.00% <0.00%> (ø)
...rest/src/main/java/org/opensearch/client/Node.java 90.74% <0.00%> (-3.60%) ⬇️
...ation/TransportClusterAllocationExplainAction.java 52.77% <ø> (-6.95%) ⬇️
...tion/TransportAddVotingConfigExclusionsAction.java 83.33% <ø> (-4.17%) ⬇️
...on/TransportClearVotingConfigExclusionsAction.java 86.04% <ø> (+2.32%) ⬆️
...tories/delete/TransportDeleteRepositoryAction.java 100.00% <ø> (ø)
...positories/get/TransportGetRepositoriesAction.java 9.37% <ø> (ø)
...repositories/put/TransportPutRepositoryAction.java 100.00% <ø> (ø)
... and 676 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

extensionsOrchestrator.extensionsInitialize();
mockLogAppender.assertAllExpectationsMatched();
}
extensionsOrchestrator.extensionsInitialize();
Copy link
Member

Choose a reason for hiding this comment

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

What exactly are we testing here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I see what you're saying, will approach a different way

@ryanbogan ryanbogan closed this Jul 27, 2022
@ryanbogan ryanbogan reopened this Jul 27, 2022
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@@ -245,68 +245,7 @@ public void testEmptyExtensionsFile() throws Exception {
expectThrows(IOException.class, () -> new ExtensionsOrchestrator(settings, extensionDir));
}

public void testExtensionsInitialize() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

Do you just want to do @Ignore for now? [1]

[1] https://www.guru99.com/junit-ignore-test.html

Copy link
Member

Choose a reason for hiding this comment

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

This is better than removing the test.
You can ignore it like mentioned below and add the issue to it.

 @Ignore("<Issue Link>")

Copy link
Member Author

Choose a reason for hiding this comment

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

Ignore is on the forbiddenApisList

Copy link
Member

Choose a reason for hiding this comment

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

Ran into this issue when I was removing User. I ended up keeping the whole test, but commenting-out the final assertion and adding an assertion that was logically opposite. See here for example.

In this case, change the two SeenEventExpectation constructors to UnseenEventExpectation with a comment pointing to the issue so when your inverted test eventually fails, whoever is debugging it (possibly you) instantly knows how to toggle it back.

Copy link
Member Author

Choose a reason for hiding this comment

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

The only problem with this solution is that the tests as is passes on local machines, but not in Jenkins. So by changing the expectations to "Unseen", the PR gradle check would pass but after that the local gradle checks would fail for everyone.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think if I just comment out the assert statements and add a similar message to yours, then the same functionality that you are suggesting could be implemented.

Copy link
Member

Choose a reason for hiding this comment

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

its nice to see we have checks every where :)

@@ -245,68 +245,7 @@ public void testEmptyExtensionsFile() throws Exception {
expectThrows(IOException.class, () -> new ExtensionsOrchestrator(settings, extensionDir));
}

public void testExtensionsInitialize() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

Ran into this issue when I was removing User. I ended up keeping the whole test, but commenting-out the final assertion and adding an assertion that was logically opposite. See here for example.

In this case, change the two SeenEventExpectation constructors to UnseenEventExpectation with a comment pointing to the issue so when your inverted test eventually fails, whoever is debugging it (possibly you) instantly knows how to toggle it back.

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2022

Gradle Check (Jenkins) Run Completed with:

@ryanbogan ryanbogan merged commit 7c8b518 into opensearch-project:feature/extensions Aug 1, 2022
@ryanbogan ryanbogan deleted the fix_orchestrator_test branch August 1, 2022 23:03
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.

5 participants