You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2020/10/20 03:52:07 UTC
[hbase] branch master updated: HBASE-25194 Do not publish workspace
in flaky find job (#2564)
This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new 90052cc HBASE-25194 Do not publish workspace in flaky find job (#2564)
90052cc is described below
commit 90052ccf1bcd5ddfcc65a03a7b95f6ec2cadcdf2
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Tue Oct 20 11:51:34 2020 +0800
HBASE-25194 Do not publish workspace in flaky find job (#2564)
Signed-off-by: Sean Busbey <bu...@apache.org>
---
dev-support/flaky-tests/flaky-reporting.Jenkinsfile | 7 ++++---
dev-support/flaky-tests/report-flakies.py | 17 ++++++++++++-----
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/dev-support/flaky-tests/flaky-reporting.Jenkinsfile b/dev-support/flaky-tests/flaky-reporting.Jenkinsfile
index 640b1cb..25e3fde 100644
--- a/dev-support/flaky-tests/flaky-reporting.Jenkinsfile
+++ b/dev-support/flaky-tests/flaky-reporting.Jenkinsfile
@@ -43,7 +43,8 @@ pipeline {
flaky_args=("${flaky_args[@]}" --urls "${JENKINS_URL}/job/HBase/job/HBase%20Nightly/job/${BRANCH_NAME}" --is-yetus True --max-builds 10)
flaky_args=("${flaky_args[@]}" --urls "${JENKINS_URL}/job/HBase/job/HBase-Flaky-Tests/job/${BRANCH_NAME}" --is-yetus False --max-builds 30)
docker build -t hbase-dev-support dev-support
- docker run --ulimit nproc=12500 -v "${WORKSPACE}":/hbase --workdir=/hbase hbase-dev-support python dev-support/flaky-tests/report-flakies.py --mvn -v "${flaky_args[@]}"
+ docker run --ulimit nproc=12500 -v "${WORKSPACE}":/hbase -u `id -u`:`id -g` --workdir=/hbase hbase-dev-support \
+ python dev-support/flaky-tests/report-flakies.py --mvn -v -o output "${flaky_args[@]}"
'''
}
}
@@ -51,13 +52,13 @@ pipeline {
post {
always {
// Has to be relative to WORKSPACE.
- archiveArtifacts artifacts: "includes,excludes,dashboard.html"
+ archiveArtifacts artifacts: "output/*"
publishHTML target: [
allowMissing: true,
keepAll: true,
alwaysLinkToLastBuild: true,
// Has to be relative to WORKSPACE
- reportDir: ".",
+ reportDir: "output",
reportFiles: 'dashboard.html',
reportName: 'Flaky Test Report'
]
diff --git a/dev-support/flaky-tests/report-flakies.py b/dev-support/flaky-tests/report-flakies.py
index 1b3161a..d29ecfa 100755
--- a/dev-support/flaky-tests/report-flakies.py
+++ b/dev-support/flaky-tests/report-flakies.py
@@ -60,6 +60,8 @@ parser.add_argument(
"strings are written to files so they can be saved as artifacts and easily imported in "
"other projects. Also writes timeout and failing tests in separate files for "
"reference.")
+parser.add_argument("-o", "--output", metavar='dir', action='store', required=False,
+ help="the output directory")
parser.add_argument("-v", "--verbose", help="Prints more logs.", action="store_true")
args = parser.parse_args()
@@ -68,6 +70,11 @@ logger = logging.getLogger(__name__)
if args.verbose:
logger.setLevel(logging.INFO)
+output_dir = '.'
+if args.output is not None:
+ output_dir = args.output
+ if not os.path.exists(output_dir):
+ os.makedirs(output_dir)
def get_bad_tests(build_url, is_yetus):
"""
@@ -257,24 +264,24 @@ for url_max_build in expanded_urls:
all_bad_tests = all_hanging_tests.union(all_failed_tests)
if args.mvn:
includes = ",".join(all_bad_tests)
- with open("./includes", "w") as inc_file:
+ with open(output_dir + "/includes", "w") as inc_file:
inc_file.write(includes)
excludes = ["**/{0}.java".format(bad_test) for bad_test in all_bad_tests]
- with open("./excludes", "w") as exc_file:
+ with open(output_dir + "/excludes", "w") as exc_file:
exc_file.write(",".join(excludes))
- with open("./timeout", "w") as timeout_file:
+ with open(output_dir + "/timeout", "w") as timeout_file:
timeout_file.write(",".join(all_timeout_tests))
- with open("./failed", "w") as failed_file:
+ with open(output_dir + "/failed", "w") as failed_file:
failed_file.write(",".join(all_failed_tests))
dev_support_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(dev_support_dir, "flaky-dashboard-template.html"), "r") as f:
template = Template(f.read())
-with open("dashboard.html", "w") as f:
+with open(output_dir + "/dashboard.html", "w") as f:
datetime = time.strftime("%m/%d/%Y %H:%M:%S")
f.write(template.render(datetime=datetime, bad_tests_count=len(all_bad_tests),
results=url_to_bad_test_results, build_ids=url_to_build_ids))