-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TRAVIS] run flaky test when label is defined (#9509)
to declare a test as flaky: * for cpp, use ``` if ( !QgsTest::runFlakyTests() ) QSKIP( "This test is disabled on Travis CI environment" ); ``` * for Python, you can use `RUN_FLAKY_TEST` environment variable
- Loading branch information
Showing
6 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import json | ||
from urllib.request import urlopen # using urllib since it is a standard module (vs. requests) | ||
from urllib.error import URLError | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description='Determines if a pull request has a defined label') | ||
parser.add_argument('pull_request', type=int, | ||
help='pull request id') | ||
parser.add_argument('label', type=int, | ||
help='label ID') | ||
|
||
args = parser.parse_args() | ||
|
||
url = "https://api.github.com/repos/qgis/QGIS/pulls/{}".format(args.pull_request) | ||
|
||
try: | ||
data = urlopen(url).read().decode('utf-8') | ||
except URLError as err: | ||
print("URLError: ".format(err.reason)) | ||
sys.exit(1) | ||
|
||
obj = json.loads(data) | ||
|
||
for label in obj['labels']: | ||
if label["id"] == args.label: | ||
print("true") | ||
sys.exit(0) | ||
|
||
print("label not found") | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters