Add backwards compatibility tests#199
Conversation
Signed-off-by: Mohammad Qureshi <qreshi@amazon.com>
…tions Signed-off-by: Mohammad Qureshi <qreshi@amazon.com>
|
Is there a reason we are using the snapshot version of alerting 1.1 zip? |
… manually uploading Signed-off-by: Mohammad Qureshi <qreshi@amazon.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #199 +/- ##
============================================
+ Coverage 78.83% 78.86% +0.02%
+ Complexity 215 214 -1
============================================
Files 172 172
Lines 6951 6964 +13
Branches 905 908 +3
============================================
+ Hits 5480 5492 +12
- Misses 986 987 +1
Partials 485 485 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I updated the newest artifact to be generated automatically but I think it will always be the snapshot since that's the default for most recent point-in-time artifact being built. |
| // on time | ||
| // TODO: Should probably change the next execution time of the Monitor manually instead since this inflates | ||
| // the test execution by a lot | ||
| Thread.sleep(60000) |
There was a problem hiding this comment.
Can we avoid sleep(...) ?
There was a problem hiding this comment.
I had originally planned on adding a utility method like what ISM had added:
As well as a waitFor wrapper so we could add assertions that could wait for the Monitor to execute and confirm state afterwards:
However, it looks like the JobScheduler implementation of the schedule information stores things like start_time which is convenient to modify for the particular scheduled job you'd like to speed up in test scenarios:
Alerting's scheduled job implementation does not do this and instead uses enabled_time to resolve the next expected execution time only if the expectedPreviousExecutionTime is not set, otherwise it uses that:
The expectedPreviousExecutionTime is stored in scheduledJobIdToInfo which is part of a concurrent hashmap which is stored in memory as far as I'm aware:
This would make modification of an already running Monitor to execute sooner less trivial than expected. I'd like to leave it out of scope of this particular PR for now and have it be a possible follow-up for a test refactor.
There was a problem hiding this comment.
Hmm, looks like these tests do get run automatically as part of ./gradlew build so this would impact build times when running all tests. I was hoping to exclude them unless running something like ./gradlew bwcTestSuite to avoid the overhead for the time being but ./gradlew build will likely pick up all tests by nature.
There was a problem hiding this comment.
Thanks for diving deep into this. Currently gradlew build takes around 4mins, this sleep would add one more min.
There was a problem hiding this comment.
Actually, since the bwcTestSuite executes the following scenarios:
mixedCluster- Hits theMIXEDcaserollingUpgrade- Hits theMIXEDandUPGRADEDcasefullRestart- Hits theUPGRADEDcase
We'd be adding 4 minutes of sleep across all the tests since both the MIXED and UPGRADED cases are adding a sleep of 1 minute before verifying.
alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt
Show resolved
Hide resolved
alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt
Show resolved
Hide resolved
Signed-off-by: Mohammad Qureshi <qreshi@amazon.com>
Signed-off-by: Mohammad Qureshi <qreshi@amazon.com>
|
@qreshi Please confirm if |
I checked and it looks like it's not excluding the dependent tasks which run the BWC tests. This could be because they're defined as |
* Initial commit for BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update bwc test to check Monitor stats and add bwc tests to GitHub Actions Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Use current version plugin bundle from build for bwc tests instead of manually uploading Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update mockito-core dependency to 3.12.4 to prevent conflict Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Remove disabling security manager flag when running BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com>
* Initial commit for BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update bwc test to check Monitor stats and add bwc tests to GitHub Actions Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Use current version plugin bundle from build for bwc tests instead of manually uploading Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update mockito-core dependency to 3.12.4 to prevent conflict Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Remove disabling security manager flag when running BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com>
* Updates alerting version to 1.2 (#192) * Updates alerting version to 1.2 * Adds snapshot repo to the repository file Signed-off-by: Clay Downs <downsrob@amazon.com> * Update build to use public Maven repo (#184) Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com> * Publish notification JARs checksums. (#196) * Publish notification JARs checksums. Signed-off-by: dblock <dblock@dblock.org> * Remove sonatype staging. Signed-off-by: dblock <dblock@dblock.org> * Updates testCompile mockito version to match OpenSearch changes (#204) Signed-off-by: Clay Downs <downsrob@amazon.com> * Update maven publication to include cksums. (#224) This change adds a task to publish to a local staging repo under build/ that includes cksums. It also updates build.sh to use this new task and copy the contents of the staging repo to the output directory. The maven publish plugin will not include these cksums when publishing to maven local but will when published to a separate folder. Signed-off-by: Marc Handalian <handalm@amazon.com> * Add release notes for 1.2.0.0 release (#225) * Create opensearch-alerting.release-notes-1.2.0.0.md Signed-off-by: Annie Lee <leeyun@amazon.com> * Update opensearch-alerting.release-notes-1.2.0.0.md * Update opensearch-alerting.release-notes-1.2.0.0.md * Add backwards compatibility tests (#199) * Initial commit for BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update bwc test to check Monitor stats and add bwc tests to GitHub Actions Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Use current version plugin bundle from build for bwc tests instead of manually uploading Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update mockito-core dependency to 3.12.4 to prevent conflict Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Remove disabling security manager flag when running BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> Co-authored-by: Clay Downs <89109232+downsrob@users.noreply.github.com> Co-authored-by: Abbas Hussain <abbashus@amazon.com> Co-authored-by: Daniel Doubrovkine (dB.) <dblock@dblock.org> Co-authored-by: Marc Handalian <handalm@amazon.com> Co-authored-by: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com> Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com>
* Cherry-pick commits to 1.x (#227) * Update copyright notice (#222) Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Admin Users must be able to access all monitors #139 (#220) * Admin Users must be able to access all monitors #139 * Refactored Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Co-authored-by: Sriram <59816283+skkosuri-amzn@users.noreply.github.com> * Updates alerting version to 1.2 (#192) * Updates alerting version to 1.2 * Adds snapshot repo to the repository file Signed-off-by: Clay Downs <downsrob@amazon.com> * Update build to use public Maven repo (#184) Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com> * Publish notification JARs checksums. (#196) * Publish notification JARs checksums. Signed-off-by: dblock <dblock@dblock.org> * Remove sonatype staging. Signed-off-by: dblock <dblock@dblock.org> * Updates testCompile mockito version to match OpenSearch changes (#204) Signed-off-by: Clay Downs <downsrob@amazon.com> * Update maven publication to include cksums. (#224) This change adds a task to publish to a local staging repo under build/ that includes cksums. It also updates build.sh to use this new task and copy the contents of the staging repo to the output directory. The maven publish plugin will not include these cksums when publishing to maven local but will when published to a separate folder. Signed-off-by: Marc Handalian <handalm@amazon.com> * Add release notes for 1.2.0.0 release (#225) * Create opensearch-alerting.release-notes-1.2.0.0.md Signed-off-by: Annie Lee <leeyun@amazon.com> * Update opensearch-alerting.release-notes-1.2.0.0.md * Update opensearch-alerting.release-notes-1.2.0.0.md * Add backwards compatibility tests (#199) * Initial commit for BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update bwc test to check Monitor stats and add bwc tests to GitHub Actions Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Use current version plugin bundle from build for bwc tests instead of manually uploading Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update mockito-core dependency to 3.12.4 to prevent conflict Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Remove disabling security manager flag when running BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Co-authored-by: Sriram <59816283+skkosuri-amzn@users.noreply.github.com> Co-authored-by: Clay Downs <89109232+downsrob@users.noreply.github.com> Co-authored-by: Abbas Hussain <abbashus@amazon.com> Co-authored-by: Daniel Doubrovkine (dB.) <dblock@dblock.org> Co-authored-by: Marc Handalian <handalm@amazon.com> Co-authored-by: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com>
* Updates alerting version to 1.2 (opensearch-project#192) * Updates alerting version to 1.2 * Adds snapshot repo to the repository file Signed-off-by: Clay Downs <downsrob@amazon.com> * Update build to use public Maven repo (opensearch-project#184) Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com> * Publish notification JARs checksums. (opensearch-project#196) * Publish notification JARs checksums. Signed-off-by: dblock <dblock@dblock.org> * Remove sonatype staging. Signed-off-by: dblock <dblock@dblock.org> * Updates testCompile mockito version to match OpenSearch changes (opensearch-project#204) Signed-off-by: Clay Downs <downsrob@amazon.com> * Update maven publication to include cksums. (opensearch-project#224) This change adds a task to publish to a local staging repo under build/ that includes cksums. It also updates build.sh to use this new task and copy the contents of the staging repo to the output directory. The maven publish plugin will not include these cksums when publishing to maven local but will when published to a separate folder. Signed-off-by: Marc Handalian <handalm@amazon.com> * Add release notes for 1.2.0.0 release (opensearch-project#225) * Create opensearch-alerting.release-notes-1.2.0.0.md Signed-off-by: Annie Lee <leeyun@amazon.com> * Update opensearch-alerting.release-notes-1.2.0.0.md * Update opensearch-alerting.release-notes-1.2.0.0.md * Add backwards compatibility tests (opensearch-project#199) * Initial commit for BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update bwc test to check Monitor stats and add bwc tests to GitHub Actions Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Use current version plugin bundle from build for bwc tests instead of manually uploading Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Update mockito-core dependency to 3.12.4 to prevent conflict Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> * Remove disabling security manager flag when running BWC tests Signed-off-by: Mohammad Qureshi <qreshi@amazon.com> Co-authored-by: Clay Downs <89109232+downsrob@users.noreply.github.com> Co-authored-by: Abbas Hussain <abbashus@amazon.com> Co-authored-by: Daniel Doubrovkine (dB.) <dblock@dblock.org> Co-authored-by: Marc Handalian <handalm@amazon.com> Co-authored-by: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com> Co-authored-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
Issue #, if available: #147
Description of changes:
DEVELOPER_GUIDEto add instructions for running bwc testsA couple improvements that can probably be made in future iterations:
toXContentmethod that is being used in the current version of the plugin test is not forwards compatible, so we would need a workaround or some legacytoXContentmethod forMonitorif we want to use therandomMonitor()helper method for creating the Monitor requestWe can generate the current version of the artifact dynamically and place it in the expected file path when running the bwc tests so we don't have to place an artifact there each time we move the versions along (ex. the 1.1 Alerting version being used is undersrc/test/resources/bwc/alerting/1.1.0.0-SNAPSHOT/opensearch-alerting-1.1.0.0-SNAPSHOT.zip)CheckList:
[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.