Skip to content

Commit

Permalink
Add more test cases to the jenkinsfiles
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon committed Sep 15, 2023
1 parent 3128c4b commit 1310a80
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 99 deletions.
44 changes: 20 additions & 24 deletions jenkins/opensearch-dashboards/integ-test.jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
//lib = library(identifier: '[email protected]', retriever: modernSCM([
// $class: 'GitSCMSource',
// remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
//]))
lib = library(identifier: 'jenkins@windows-docker-integtest-2', retriever: modernSCM([
lib = library(identifier: '[email protected]', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/peterzhuamazon/opensearch-build-libraries.git',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
]))

def docker_images = [
Expand Down Expand Up @@ -40,12 +36,12 @@ pipeline {
BUILD_JOB_NAME_OPENSEARCH = "distribution-build-opensearch"
ARTIFACT_BUCKET_NAME = credentials('jenkins-artifact-bucket-name')
}
//triggers {
// parameterizedCron '''
// H */3 * * * %TEST_MANIFEST=2.10.0/opensearch-dashboards-2.10.0-test.yml;BUILD_MANIFEST_URL=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.10.0/latest/linux/arm64/tar/builds/opensearch-dashboards/manifest.yml;BUILD_MANIFEST_URL_OPENSEARCH=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/arm64/tar/builds/opensearch/manifest.yml
// H */3 * * * %TEST_MANIFEST=2.10.0/opensearch-dashboards-2.10.0-test.yml;BUILD_MANIFEST_URL=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.10.0/latest/linux/x64/tar/builds/opensearch-dashboards/manifest.yml;BUILD_MANIFEST_URL_OPENSEARCH=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/x64/tar/builds/opensearch/manifest.yml
// '''
//}
triggers {
parameterizedCron '''
H */3 * * * %TEST_MANIFEST=2.10.0/opensearch-dashboards-2.10.0-test.yml;BUILD_MANIFEST_URL=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.10.0/latest/linux/arm64/tar/builds/opensearch-dashboards/manifest.yml;BUILD_MANIFEST_URL_OPENSEARCH=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/arm64/tar/builds/opensearch/manifest.yml
H */3 * * * %TEST_MANIFEST=2.10.0/opensearch-dashboards-2.10.0-test.yml;BUILD_MANIFEST_URL=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.10.0/latest/linux/x64/tar/builds/opensearch-dashboards/manifest.yml;BUILD_MANIFEST_URL_OPENSEARCH=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/x64/tar/builds/opensearch/manifest.yml
'''
}
parameters {
string(
name: 'COMPONENT_NAME',
Expand Down Expand Up @@ -250,22 +246,22 @@ pipeline {
switchUserNonRoot: "${switch_user_non_root}"
)
String closeCommentMessage = "Closing the issue as the Integration Test passed for ${local_component}<br>Version: ${version}<br>Distribution: ${distribution}<br>Architecture: ${architecture}<br>Platform: ${platform}<br><br>Please check the logs: ${RUN_DISPLAY_URL}<br><br> *"
//closeGithubIssue(
// repoUrl: buildManifestObj.getRepo("${local_component}"),
// issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
// closeComment: closeCommentMessage,
// label: "autocut,v${version},integ-test-failure"
//)
closeGithubIssue(
repoUrl: buildManifestObj.getRepo("${local_component}"),
issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
closeComment: closeCommentMessage,
label: "autocut,v${version},integ-test-failure"
)
}
} catch (e) {
echo "Error running integtest for component ${local_component}, creating Github issue"
String issueBodyMessage = "The integration test failed at distribution level for component ${local_component}<br>Version: ${version}<br>Distribution: ${distribution}<br>Architecture: ${architecture}<br>Platform: ${platform}<br><br>Please check the logs: ${RUN_DISPLAY_URL}<br><br> * Test-report manifest:*<br> - https://ci.opensearch.org/ci/dbc/${JOB_NAME}/${version}/${buildId}/${platform}/${architecture}/${distribution}/test-results/${BUILD_NUMBER}/integ-test/test-report.yml <br><br> _Note: Steps to reproduce, additional logs and other files can be found within the above test-report manifest. <br>Instructions of this test-report manifest can be found [here](https://github.com/opensearch-project/opensearch-build/tree/main/src/report_workflow#guide-on-test-report-manifest-from-ci)._"
//createGithubIssue(
// repoUrl: buildManifestObj.getRepo("${local_component}"),
// issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
// issueBody: issueBodyMessage,
// label: "autocut,v${version},integ-test-failure"
//)
createGithubIssue(
repoUrl: buildManifestObj.getRepo("${local_component}"),
issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
issueBody: issueBodyMessage,
label: "autocut,v${version},integ-test-failure"
)
throw new Exception("Error running integtest for component ${local_component}", e)
} finally {
echo "Completed running integtest for component ${local_component}"
Expand Down
44 changes: 20 additions & 24 deletions jenkins/opensearch/integ-test.jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
//lib = library(identifier: '[email protected]', retriever: modernSCM([
// $class: 'GitSCMSource',
// remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
//]))
lib = library(identifier: 'jenkins@windows-docker-integtest-2', retriever: modernSCM([
lib = library(identifier: '[email protected]', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/peterzhuamazon/opensearch-build-libraries.git',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
]))

def docker_images = [
Expand Down Expand Up @@ -38,12 +34,12 @@ pipeline {
BUILD_JOB_NAME = "distribution-build-opensearch"
ARTIFACT_BUCKET_NAME = credentials('jenkins-artifact-bucket-name')
}
//triggers {
// parameterizedCron '''
// H 3 * * * %TEST_MANIFEST=2.10.0/opensearch-2.10.0-concurrent-search-test.yml;BUILD_MANIFEST_URL=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/arm64/tar/builds/opensearch/manifest.yml
// H 3 * * * %TEST_MANIFEST=2.10.0/opensearch-2.10.0-concurrent-search-test.yml;BUILD_MANIFEST_URL=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/x64/tar/builds/opensearch/manifest.yml
// '''
//}
triggers {
parameterizedCron '''
H 3 * * * %TEST_MANIFEST=2.10.0/opensearch-2.10.0-concurrent-search-test.yml;BUILD_MANIFEST_URL=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/arm64/tar/builds/opensearch/manifest.yml
H 3 * * * %TEST_MANIFEST=2.10.0/opensearch-2.10.0-concurrent-search-test.yml;BUILD_MANIFEST_URL=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.10.0/latest/linux/x64/tar/builds/opensearch/manifest.yml
'''
}
parameters {
string(
name: 'COMPONENT_NAME',
Expand Down Expand Up @@ -200,22 +196,22 @@ pipeline {
switchUserNonRoot: "${switch_user_non_root}"
)
String closeCommentMessage = "Closing the issue as the Integration Test passed for ${local_component}<br>Version: ${version}<br>Distribution: ${distribution}<br>Architecture: ${architecture}<br>Platform: ${platform}<br><br>Please check the logs: ${RUN_DISPLAY_URL}<br><br> *"
//closeGithubIssue(
// repoUrl: buildManifestObj.getRepo("${local_component}"),
// issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
// closeComment: closeCommentMessage,
// label: "autocut,v${version},integ-test-failure"
//)
closeGithubIssue(
repoUrl: buildManifestObj.getRepo("${local_component}"),
issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
closeComment: closeCommentMessage,
label: "autocut,v${version},integ-test-failure"
)
}
} catch (e) {
echo "Error running integtest for component ${local_component}, creating Github issue"
String issueBodyMessage = "The integration test failed at distribution level for component ${local_component}<br>Version: ${version}<br>Distribution: ${distribution}<br>Architecture: ${architecture}<br>Platform: ${platform}<br><br>Please check the logs: ${RUN_DISPLAY_URL}<br><br> * Test-report manifest:*<br> - https://ci.opensearch.org/ci/dbc/${JOB_NAME}/${version}/${buildId}/${platform}/${architecture}/${distribution}/test-results/${BUILD_NUMBER}/integ-test/test-report.yml <br><br> _Note: Steps to reproduce, additional logs and other files can be found within the above test-report manifest. <br>Instructions of this test-report manifest can be found [here](https://github.com/opensearch-project/opensearch-build/tree/main/src/report_workflow#guide-on-test-report-manifest-from-ci)._"
//createGithubIssue(
// repoUrl: buildManifestObj.getRepo("${local_component}"),
// issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
// issueBody: issueBodyMessage,
// label: "autocut,v${version},integ-test-failure"
//)
createGithubIssue(
repoUrl: buildManifestObj.getRepo("${local_component}"),
issueTitle: "[AUTOCUT] Integration Test failed for ${local_component}: ${version} ${distribution} distribution",
issueBody: issueBodyMessage,
label: "autocut,v${version},integ-test-failure"
)
throw new Exception("Error running integtest for component ${local_component}", e)
} finally {
echo "Completed running integtest for component ${local_component}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __setup_cluster_and_execute_test_config(self, config: str) -> int:
config,
self.test_recorder,
) as (endpoint, port):
self.pretty_print_message("Running integration tests for " + self.component.name)
self.pretty_print_message("Running integration tests for " + self.component.name + " " + config)
os.chdir(self.work_dir)
return self.execute_integtest_sh(endpoint, port, security, config)

Expand Down
2 changes: 1 addition & 1 deletion tests/jenkins/TestOpenSearchDashboardsIntegTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TestOpenSearchDashboardsIntegTest extends BuildPipelineTest {

helper.registerSharedLibrary(
library().name('jenkins')
.defaultVersion('5.7.1')
.defaultVersion('5.9.1')
.allowOverride(true)
.implicit(true)
.targetPath('vars')
Expand Down
2 changes: 1 addition & 1 deletion tests/jenkins/TestOpenSearchIntegTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TestOpenSearchIntegTest extends BuildPipelineTest {

helper.registerSharedLibrary(
library().name('jenkins')
.defaultVersion('5.7.1')
.defaultVersion('5.9.1')
.allowOverride(true)
.implicit(true)
.targetPath('vars')
Expand Down
Loading

0 comments on commit 1310a80

Please sign in to comment.