Skip to content

Commit

Permalink
Fix docker tag to unblock running integ tests in CI (#431)
Browse files Browse the repository at this point in the history
* Fix docker tag to unblock running integ tests in CI

Signed-off-by: Tyler Ohlsen <[email protected]>

* Update error message typo

Signed-off-by: Tyler Ohlsen <[email protected]>

* Add a step to create the index with time field in createAnomalyDetector helper

Signed-off-by: Tyler Ohlsen <[email protected]>

* Refactor index creation to failing tests only

Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler authored Mar 11, 2022
1 parent c776546 commit 5dbec30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Pull and Run Docker
run: |
plugin=`ls build/distributions/*.zip`
version=1.3.0-SNAPSHOT
version=1.3.0
plugin_version=1.3.0.0-SNAPSHOT
echo Using OpenSearch $version with AD $plugin_version
cd ..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static String getTooManyCategoricalFieldErr(int limit) {
public static String TIME_FIELD_NOT_ENOUGH_HISTORICAL_DATA =
"There isn't enough historical data found with current timefield selected.";
public static String DETECTOR_INTERVAL_REC =
"The selected detector interval might collect sparse data. Consider changing interval length too: ";
"The selected detector interval might collect sparse data. Consider changing interval length to: ";
public static String RAW_DATA_TOO_SPARSE =
"Source index data is potentially too sparse for model training. Consider changing interval length or ingesting more data";
public static String MODEL_VALIDATION_FAILED_UNEXPECTEDLY = "Model validation experienced issues completing.";
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/org/opensearch/ad/rest/SecureADRestIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ public void testUpdateApiFilterByEnabled() throws IOException {
// User Fish has AD full access, and has "odfe" backend role which is one of Alice's backend role, so
// Fish should be able to update detectors created by Alice. But the detector's backend role should
// not be replaced as Fish's backend roles.
TestHelpers.createIndexWithTimeField(client(), newDetector.getIndices().get(0), newDetector.getTimeField());
Response response = updateAnomalyDetector(aliceDetector.getDetectorId(), newDetector, fishClient);
Assert.assertEquals(response.getStatusLine().getStatusCode(), 200);
AnomalyDetector anomalyDetector = getAnomalyDetector(aliceDetector.getDetectorId(), aliceClient);
Expand Down Expand Up @@ -314,6 +315,7 @@ public void testCreateAnomalyDetectorWithCustomResultIndex() throws IOException

// User cat has permission to create index
resultIndex = CommonName.CUSTOM_RESULT_INDEX_PREFIX + "test2";
TestHelpers.createIndexWithTimeField(client(), anomalyDetector.getIndices().get(0), anomalyDetector.getTimeField());
AnomalyDetector detectorOfCat = createAnomalyDetector(cloneDetector(anomalyDetector, resultIndex), true, catClient);
assertEquals(resultIndex, detectorOfCat.getResultIndex());
}
Expand Down

0 comments on commit 5dbec30

Please sign in to comment.