sapling/eden/scm/tests/update-to-py3-utils/retry-skipped.py
Simon Farnsworth 9266779248 py3: tools to quickly remove the py2 only marking from tests
Summary:
Simple tools, based on D19664298, that use the JSON report to enable py2 only tests for py3 testing, and revert the changes to those tests that fail.

update-successes.py is just xavierd's original code

Use as needed to enable tests on py3 after debugging, A recommended workflow is in the test plan

Reviewed By: singhsrb

Differential Revision: D19670838

fbshipit-source-id: fc525941cb010c9038c1f73d89913420e0c79981
2020-01-31 16:35:39 -08:00

19 lines
579 B
Python
Executable File

#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
import json
import subprocess
with open("report.json", "r") as f:
tests = json.load(f)
for name, t in tests.items():
name = name.split(" ")[0]
if t["result"] == "skip":
print("%s skipped" % name)
subprocess.run("sed -i '/#require py2/d' %s" % name, shell=True)
subprocess.run("sed -i '/require.*py2/d' %s" % name, shell=True)