-
Notifications
You must be signed in to change notification settings - Fork 274
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 lib to 6.5.0 and add gradle-check-flaky-test-issue-creation.jenkinsfile
.
#4777
Update the lib to 6.5.0 and add gradle-check-flaky-test-issue-creation.jenkinsfile
.
#4777
Conversation
e2d5b29
to
6df2a71
Compare
The 6.5.0 library is just released https://github.com/opensearch-project/opensearch-build-libraries/releases/tag/6.5.0. |
stage('Detect Gradle Check Flaky Tests') { | ||
steps { | ||
script { | ||
gradleCheckFlakyTestChecker() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to add tests for this jenkinsFile specifically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this limitation currently its not possible opensearch-project/opensearch-build-libraries#436 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So even the regression txt file wont be generated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wont Sayali initially I have tried it, but the line it reaches gradleCheckFlakyTestChecker
it starts failing for this line here https://github.com/opensearch-project/opensearch-build-libraries/blob/main/src/gradlecheck/FetchPostMergeFailedTestClass.groovy#L77 as it's not able to find the class OpenSearchMetricsQuery
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried the following way but fails at OpenSearchMetricsQuery
, its not able to mock external classes part of the used library.
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import jenkins.tests.BuildPipelineTest
import org.junit.Before
import org.junit.Test
import org.yaml.snakeyaml.Yaml
import static com.lesfurets.jenkins.unit.global.lib.LibraryConfiguration.library
import static com.lesfurets.jenkins.unit.global.lib.GitSource.gitSource
import static com.lesfurets.jenkins.unit.MethodCall.callArgsToString
import static org.hamcrest.CoreMatchers.hasItem
import static org.hamcrest.MatcherAssert.assertThat
import static org.junit.jupiter.api.Assertions.assertThrows
class TestGradleCheckFlakyTestIssueCreation extends BuildPipelineTest {
def mockedResponseHere = '''
{
"aggregations": {
"test_class_keyword_agg": {
"buckets": [
{
"key": "TestClass1",
"doc_count": 10
},
{
"key": "TestClass2",
"doc_count": 5
}
]
}
}
}
'''
@Override
@Before
void setUp() {
helper.registerSharedLibrary(
library().name('jenkins')
.defaultVersion('main')
.allowOverride(true)
.implicit(true)
.targetPath('vars')
.retriever(gitSource('https://github.com/prudhvigodithi/opensearch-build-libraries.git'))
.build()
)
super.setUp()
addParam('METRICS_HOST_ACCOUNT', '1.0.0')
helper.registerAllowedMethod('withAWS', [Map, Closure], null)
def openSearchMetricsQueryMock = new OpenSearchMetricsQuery('', '', '', '', null)
openSearchMetricsQueryMock.metaClass.fetchMetrics = { String query ->
return new groovy.json.JsonSlurper().parseText(mockedResponseHere)
}
}
@Test
void jenkinsFileExecution() {
super.testPipeline('jenkins/gradle/gradle-check-flaky-test-issue-creation.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/promotion/gradle-check-flaky-test-issue-creation.jenkinsfile')
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird! @dblock Maybe you have some idea here?
Looks like groovy tests are still failing. Can you please fix them before merging? |
…n.jenkinsfile Signed-off-by: Prudhvi Godithi <[email protected]>
6df2a71
to
193f6f1
Compare
Sure Sayali will take care of it. |
Description
Update the lib to 6.5.0 to fix the issue with
gh issue list
, refer [Bug]: Thegh issue list
used in libraries having--label
flag creates a new issue for the same title and different labels. opensearch-build-libraries#441. The PR to fix this is Remove--label
flag forgh issue list
opensearch-build-libraries#442.Add
gradle-check-flaky-test-issue-creation.jenkinsfile
to fix the issue Add additional details on Gradle Check failures autocut issues OpenSearch#13950. This jenkinsfile uses the librarygradleCheckFlakyTestChecker
that is part of PR Creating Issue Reports for Flaky Test Failures in Gradle Check opensearch-build-libraries#436.Issues Resolved
Part of opensearch-project/OpenSearch#13950 and opensearch-project/opensearch-build-libraries#441
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.