diff --git a/src/gradlecheck/FetchPostMergeFailedTestClass.groovy b/src/gradlecheck/FetchPostMergeFailedTestClass.groovy index faa4b3d4..9ff29fce 100644 --- a/src/gradlecheck/FetchPostMergeFailedTestClass.groovy +++ b/src/gradlecheck/FetchPostMergeFailedTestClass.groovy @@ -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 } } diff --git a/src/gradlecheck/OpenSearchMetricsQuery.groovy b/src/gradlecheck/OpenSearchMetricsQuery.groovy index d732677d..1210bc76 100644 --- a/src/gradlecheck/OpenSearchMetricsQuery.groovy +++ b/src/gradlecheck/OpenSearchMetricsQuery.groovy @@ -32,10 +32,11 @@ class OpenSearchMetricsQuery { 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 '.' + curl -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 '.' """, returnStdout: true ).trim() + println("The response OpenSearchMetricsQuery is" + response) return new JsonSlurper().parseText(response) } } \ No newline at end of file diff --git a/vars/gradleCheckFlakyTestDetector.groovy b/vars/gradleCheckFlakyTestDetector.groovy index 563141ea..8ee290aa 100644 --- a/vars/gradleCheckFlakyTestDetector.groovy +++ b/vars/gradleCheckFlakyTestDetector.groovy @@ -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 - ) + )*/ } } }