Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
prudhvigodithi committed Jul 27, 2023
2 parents 70507a0 + 5b00d67 commit abb9b24
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/groovy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- name: Run Tests
run: |
./gradlew test --info --tests=TestCloseGithubIssue
./gradlew test --info
- name: Upload Coverage Report
uses: codecov/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion tests/jenkins/TestCloseBuildSuccessGithubIssue.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TestCloseBuildSuccessGithubIssue extends BuildPipelineTest {

@Test
public void testExistingGithubIssue() {
super.testPipeline('tests/jenkins/jobs/CloseBuildSuccessGithubIssue_Jenkinsfile')
super.testPipeline('tests/jenkins/jobs/CloseBuildSuccessGithubIssue_JenkinsFile')
assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue list --repo https://github.com/opensearch-project/OpenSearch.git -S \"[AUTOCUT] Distribution Build Failed for OpenSearch-2.0.0 in:title\" --label autocut,v2.0.0 --json number --jq '.[0].number', returnStdout=true}"))
assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue close bbb\nccc -R opensearch-project/OpenSearch --comment \"Closing the issue as the distribution build for OpenSearch has passed for version: **2.0.0**.\n Please see build log at www.example.com/jobs/test/123/consoleFull\", returnStdout=true}"))
}
Expand Down
4 changes: 2 additions & 2 deletions tests/jenkins/TestCloseGithubIssue.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class TestCloseGithubIssue extends BuildPipelineTest {
'label101',
))
super.testPipeline("tests/jenkins/jobs/CloseGithubIssue_JenkinsFile")
// assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue list --repo https://github.com/opensearch-project/opensearch-build -S \"Test GH issue title in:title\" --label label101 --json number --jq '.[0].number', returnStdout=true}"))
// assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue close bbb\nccc -R opensearch-project/opensearch-build --comment \"Test GH issue close comment\", returnStdout=true}"))
assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue list --repo https://github.com/opensearch-project/opensearch-build -S \"Test GH issue title in:title\" --label label101 --json number --jq '.[0].number', returnStdout=true}"))
assertThat(getCommands('sh', 'script'), hasItem("{script=gh issue close bbb\nccc -R opensearch-project/opensearch-build --comment \"Test GH issue close comment\", returnStdout=true}"))
}

def getCommands(method, text) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CloseBuildSuccessGithubIssue_Jenkinsfile.run()
CloseBuildSuccessGithubIssue_Jenkinsfile.pipeline(groovy.lang.Closure)
CloseBuildSuccessGithubIssue_Jenkinsfile.echo(Executing on agent [label:none])
CloseBuildSuccessGithubIssue_Jenkinsfile.stage(notify, groovy.lang.Closure)
CloseBuildSuccessGithubIssue_Jenkinsfile.script(groovy.lang.Closure)
CloseBuildSuccessGithubIssue_Jenkinsfile.closeBuildSuccessGithubIssue({message=[Build successful OpenSearch], inputManifestPath=tests/data/opensearch-2.0.0.yml})
CloseBuildSuccessGithubIssue_JenkinsFile.run()
CloseBuildSuccessGithubIssue_JenkinsFile.pipeline(groovy.lang.Closure)
CloseBuildSuccessGithubIssue_JenkinsFile.echo(Executing on agent [label:none])
CloseBuildSuccessGithubIssue_JenkinsFile.stage(notify, groovy.lang.Closure)
CloseBuildSuccessGithubIssue_JenkinsFile.script(groovy.lang.Closure)
CloseBuildSuccessGithubIssue_JenkinsFile.closeBuildSuccessGithubIssue({message=[Build successful OpenSearch], inputManifestPath=tests/data/opensearch-2.0.0.yml})
closeBuildSuccessGithubIssue.legacySCM(groovy.lang.Closure)
closeBuildSuccessGithubIssue.library({identifier=jenkins@main, retriever=null})
closeBuildSuccessGithubIssue.readYaml({file=tests/data/opensearch-2.0.0.yml})
Expand Down
4 changes: 2 additions & 2 deletions tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
./gradlew --stop
rm -rf ~/.gradle

if ! (uname -s | grep -i NT); then
if command -v docker > /dev/null; then
echo "Check existing dockercontainer"
docker ps -a
docker stop `docker ps -qa` > /dev/null 2>&1 || echo
docker rm `docker ps -qa` > /dev/null 2>&1 || echo
docker rm --force `docker ps -qa` > /dev/null 2>&1 || echo
echo "Stop existing dockercontainer"
docker ps -a

Expand Down
4 changes: 2 additions & 2 deletions vars/runGradleCheck.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ void call(Map args = [:]) {
./gradlew --stop
rm -rf ~/.gradle
if ! (uname -s | grep -i NT); then
if command -v docker > /dev/null; then
echo "Check existing dockercontainer"
docker ps -a
docker stop `docker ps -qa` > /dev/null 2>&1 || echo
docker rm `docker ps -qa` > /dev/null 2>&1 || echo
docker rm --force `docker ps -qa` > /dev/null 2>&1 || echo
echo "Stop existing dockercontainer"
docker ps -a
Expand Down

0 comments on commit abb9b24

Please sign in to comment.