Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the component_build_result field for Not Available scenario. #465

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update the component build result for Not Available scenario
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
  • Loading branch information
prudhvigodithi committed Jul 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 3e2025d2e2ce3260f3c3d0b3e7538a1369c8e0e3
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ jacocoTestReport {
}
}

String version = '6.7.1'
String version = '6.7.2'

task updateVersion {
doLast {
46 changes: 46 additions & 0 deletions tests/jenkins/TestPublishIntegTestResults.groovy
Original file line number Diff line number Diff line change
@@ -208,6 +208,52 @@ class TestPublishIntegTestResults extends BuildPipelineTest {
assert parsedResult == expectedJson
}

@Test
void testComponentResultWithSecurityFail() {
def withSecurity = 'fail'
def withoutSecurity = 'pass'
def componentResult = (withSecurity == 'fail' || withoutSecurity == 'fail' || withSecurity == 'Not Available' || withoutSecurity == 'Not Available') ? 'failed' : 'passed'

assert componentResult == 'failed'
}

@Test
void testComponentResultWithoutSecurityFail() {
def withSecurity = 'pass'
def withoutSecurity = 'fail'
def componentResult = (withSecurity == 'fail' || withoutSecurity == 'fail' || withSecurity == 'Not Available' || withoutSecurity == 'Not Available') ? 'failed' : 'passed'

assert componentResult == 'failed'
}

@Test
void testComponentResultWithSecurityNotAvailable() {
def withSecurity = 'Not Available'
def withoutSecurity = 'pass'
def componentResult = (withSecurity == 'fail' || withoutSecurity == 'fail' || withSecurity == 'Not Available' || withoutSecurity == 'Not Available') ? 'failed' : 'passed'

assert componentResult == 'failed'
}

@Test
void testComponentResultWithoutSecurityNotAvailable() {
def withSecurity = 'pass'
def withoutSecurity = 'Not Available'
def componentResult = (withSecurity == 'fail' || withoutSecurity == 'fail' || withSecurity == 'Not Available' || withoutSecurity == 'Not Available') ? 'failed' : 'passed'

assert componentResult == 'failed'
}

@Test
void testComponentResultBothPass() {
def withSecurity = 'pass'
def withoutSecurity = 'pass'
def componentResult = (withSecurity == 'fail' || withoutSecurity == 'fail' || withSecurity == 'Not Available' || withoutSecurity == 'Not Available') ? 'failed' : 'passed'

assert componentResult == 'passed'
}


@Test
void testCallWithMissingArgs() {
def script = loadScript('vars/publishIntegTestResults.groovy')
2 changes: 1 addition & 1 deletion vars/publishIntegTestResults.groovy
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ void call(Map args = [:]) {
def componentCategory = manifest.name
def withSecurity = component.configs.find { it.name == 'with-security' }?.status?.toLowerCase() ?: 'unknown'
def withoutSecurity = component.configs.find { it.name == 'without-security' }?.status?.toLowerCase() ?: 'unknown'
def componentResult = (withSecurity == 'fail' || withoutSecurity == 'fail') ? 'failed' : 'passed'
def componentResult = (withSecurity == 'fail' || withoutSecurity == 'fail' || withSecurity == 'Not Available' || withoutSecurity == 'Not Available') ? 'failed' : 'passed'
def withSecurityYml = component.configs.find { it.name == 'with-security' }?.yml ?: ''
def withSecurityStdout = component.configs.find { it.name == 'with-security' }?.cluster_stdout ?: []
def withSecurityStderr = component.configs.find { it.name == 'with-security' }?.cluster_stderr ?: []