-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 5.x] Add support for continue-on-error flag for build and a…
…dd tests cases (#274) Signed-off-by: Sayali Gaikawad <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b8e2f8c
commit b6dad92
Showing
5 changed files
with
131 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
import static org.hamcrest.CoreMatchers.notNullValue | ||
import static org.hamcrest.CoreMatchers.nullValue | ||
import static org.hamcrest.MatcherAssert.assertThat | ||
|
||
class BuildManifestLibTester extends LibFunctionTester { | ||
private String inputManifestPath | ||
private String distribution = 'tar' | ||
private String componentName | ||
private Boolean snapshot = false | ||
private Boolean lock = false | ||
private Boolean continueOnError = false | ||
|
||
public BuildManifestLibTester(String inputManifestPath){ | ||
this.inputManifestPath = inputManifestPath | ||
} | ||
|
||
public BuildManifestLibTester(String inputManifestPath, String distribution, Boolean snapshot){ | ||
this.inputManifestPath = inputManifestPath | ||
this.distribution = distribution | ||
this.snapshot = snapshot | ||
} | ||
|
||
public BuildManifestLibTester(String inputManifestPath, String distribution, String componentName, Boolean snapshot){ | ||
this.inputManifestPath = inputManifestPath | ||
this.distribution = distribution | ||
this.componentName = componentName | ||
this.snapshot = snapshot | ||
} | ||
|
||
public BuildManifestLibTester(String inputManifestPath, String distribution, Boolean snapshot, Boolean continueOnError){ | ||
this.inputManifestPath = inputManifestPath | ||
this.distribution = distribution | ||
this.snapshot = snapshot | ||
this.continueOnError = continueOnError | ||
} | ||
|
||
public BuildManifestLibTester(String inputManifestPath, String distribution, String componentName, Boolean lock, Boolean continueOnError){ | ||
this.inputManifestPath = inputManifestPath | ||
this.distribution = distribution | ||
this.componentName = componentName | ||
this.lock = lock | ||
this.continueOnError = continueOnError | ||
} | ||
|
||
@Override | ||
void configure(helper, binding) { | ||
helper.registerAllowedMethod("checkout", [Map], {}) | ||
} | ||
|
||
@Override | ||
void parameterInvariantsAssertions(call) { | ||
assertThat(call.args.inputManifest.first(), notNullValue()) | ||
} | ||
|
||
@Override | ||
boolean expectedParametersMatcher(call) { | ||
return call.args.inputManifest.first().equals(this.inputManifestPath) | ||
} | ||
|
||
@Override | ||
String libFunctionName() { | ||
return 'buildManifest' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters