Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi committed Oct 1, 2024
1 parent 2f05fd8 commit afd1a9a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/gradlecheck/FetchPostMergeFailedTestClass.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ class FetchPostMergeFailedTestClass {

def getPostMergeFailedTestClass(timeFrame) {
def jsonResponse = new OpenSearchMetricsQuery(metricsUrl,awsAccessKey, awsSecretKey, awsSessionToken, script).fetchMetrics(getQuery(timeFrame))
println(jsonResponse)
def keys = jsonResponse.aggregations.test_class_keyword_agg.buckets.collect { it.key }
println(keys)
return keys
}
}
5 changes: 2 additions & 3 deletions src/gradlecheck/OpenSearchMetricsQuery.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ class OpenSearchMetricsQuery {
def fetchMetrics(String query) {
def response = script.sh(
script: """
set -e
set +x
MONTH_YEAR=\$(date +"%m-%Y")
curl -s -XGET "${metricsUrl}/gradle-check-*/_search" --aws-sigv4 "aws:amz:us-east-1:es" --user "${awsAccessKey}:${awsSecretKey}" -H "x-amz-security-token:${awsSessionToken}" -H 'Content-Type: application/json' -d "${query}" | jq '.'
echo `curl -XGET "${metricsUrl}/gradle-check/_mapping" --aws-sigv4 "aws:amz:us-east-1:es" --user "${awsAccessKey}:${awsSecretKey}" -H "x-amz-security-token:${awsSessionToken}" -H 'Content-Type: application/json'`
""",
returnStdout: true
).trim()
println("The response OpenSearchMetricsQuery is" + response)
return new JsonSlurper().parseText(response)
}
}
4 changes: 2 additions & 2 deletions vars/gradleCheckFlakyTestDetector.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ void call(Map args = [:]) {
def testNameAdditionalPullRequests = new FetchTestPullRequests(metricsUrl, awsAccessKey, awsSecretKey, awsSessionToken, this).getTestPullRequests(failedTest).findAll { !allPullRequests.contains(it) }
def markdownTable = new CreateMarkDownTable(failedTest, testData, testNameAdditionalPullRequests).createMarkdownTable()
writeFile file: "${failedTest}.md", text: markdownTable
gradleCheckFlakyTestGitHubIssue(
/*gradleCheckFlakyTestGitHubIssue(
repoUrl: "https://github.com/opensearch-project/OpenSearch",
issueTitle: "[AUTOCUT] Gradle Check Flaky Test Report for ${failedTest}",
issueBodyFile: "${failedTest}.md",
label: args.issueLabels,
issueEdit: true
)
)*/
}
}
}
Expand Down

0 comments on commit afd1a9a

Please sign in to comment.