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

Parameterize tests with OpenSearchIntegTestCase.SuiteScopeTestCase annotation #9916

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

neetikasinghal
Copy link
Contributor

Description

Parameterize tests annotated with @OpenSearchIntegTestCase.SuiteScopeTestCase.
Without this, the parameterization is not working as initializeSuiteScope() expects a default constructor and we have a different constructor with parameterization.
ref: https://build.ci.opensearch.org/job/gradle-check/24979/testReport/junit/org.opensearch.search.aggregations/MissingValueIT/classMethod/
this has many classes failing with this exception: https://build.ci.opensearch.org/job/gradle-check/24979/#showFailuresLink

Related Issues

Relates #9443

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@neetikasinghal
Copy link
Contributor Author

neetikasinghal commented Sep 7, 2023

@sohami @reta @andrross please review.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

Gradle Check (Jenkins) Run Completed with:

@neetikasinghal
Copy link
Contributor Author

Gradle Check (Jenkins) Run Completed with:

#9815 - this is currently being fixed.

@sohami
Copy link
Collaborator

sohami commented Sep 7, 2023

I don't have any other suggestion for this change. So LGTM. @reta / @andrross Do you have any feedback for this specific handling ?

…peTestCase annotation

Signed-off-by: Neetika Singhal <neetiks@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Compatibility status:

Checks if related components are compatible with change 1d4eb4b

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git]

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Gradle Check (Jenkins) Run Completed with:

@reta reta changed the title Parameterize tests with OpenSearchIntegTestCase.SuiteScopeTestCase annoation Parameterize tests with OpenSearchIntegTestCase.SuiteScopeTestCase annotation Sep 8, 2023
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Compatibility status:

Checks if related components are compatible with change c3ddf86

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git]

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Gradle Check (Jenkins) Run Completed with:

@reta reta merged commit 8e5e54b into opensearch-project:main Sep 8, 2023
12 checks passed
@reta reta added backport 2.x Backport to 2.x branch backport 2.10 Backport to 2.10 branch labels Sep 8, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.10 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.10 2.10
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.10
# Create a new branch
git switch --create backport/backport-9916-to-2.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8e5e54b3a0d4e9c49f6ff062af361cf88ec76322
# Push it to GitHub
git push --set-upstream origin backport/backport-9916-to-2.10
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.10

Then, create a pull request where the base branch is 2.10 and the compare/head branch is backport/backport-9916-to-2.10.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-9916-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8e5e54b3a0d4e9c49f6ff062af361cf88ec76322
# Push it to GitHub
git push --set-upstream origin backport/backport-9916-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-9916-to-2.x.

* For tests defined with, SuiteScopeTestCase return true if the
* class has a constructor that takes a single Settings parameter
* */
private static boolean isSuiteScopedTestParameterized(Class<?> clazz) {
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick, but there's technically nothing to do with "suite scope" in this method. Something like "hasSettingsConstructor()" or "hasSingleAritySettingsConstructor()" or similar might be better.

neetikasinghal added a commit to neetikasinghal/OpenSearch that referenced this pull request Sep 8, 2023
…peTestCase annotation (opensearch-project#9916)

Signed-off-by: Neetika Singhal <neetiks@amazon.com>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit 8e5e54b)
neetikasinghal added a commit to neetikasinghal/OpenSearch that referenced this pull request Sep 8, 2023
…peTestCase annotation (opensearch-project#9916)

Signed-off-by: Neetika Singhal <neetiks@amazon.com>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit 8e5e54b)
kaushalmahi12 pushed a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 12, 2023
…peTestCase annotation (opensearch-project#9916)

Signed-off-by: Neetika Singhal <neetiks@amazon.com>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
neetikasinghal added a commit to neetikasinghal/OpenSearch that referenced this pull request Sep 12, 2023
…peTestCase annotation (opensearch-project#9916)

Signed-off-by: Neetika Singhal <neetiks@amazon.com>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit 8e5e54b)
reta pushed a commit that referenced this pull request Sep 12, 2023
…peTestCase annotation (#9916) (#10002)

Signed-off-by: Neetika Singhal <neetiks@amazon.com>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit 8e5e54b)
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/OpenSearch that referenced this pull request Sep 20, 2023
…peTestCase annotation (opensearch-project#9916)

Signed-off-by: Neetika Singhal <neetiks@amazon.com>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
brusic pushed a commit to brusic/OpenSearch that referenced this pull request Sep 25, 2023
…peTestCase annotation (opensearch-project#9916)

Signed-off-by: Neetika Singhal <neetiks@amazon.com>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
Signed-off-by: Ivan Brusic <ivan.brusic@flocksafety.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…peTestCase annotation (opensearch-project#9916)

Signed-off-by: Neetika Singhal <neetiks@amazon.com>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport 2.10 Backport to 2.10 branch backport-failed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants