File tree Expand file tree Collapse file tree 6 files changed +46
-3
lines changed Expand file tree Collapse file tree 6 files changed +46
-3
lines changed Original file line number Diff line number Diff line change 1
1
2
2
# Env variables for Docker
3
- # These without assignment are taken from the host env variabbles
3
+ # These without assignment are taken from the host env variables
4
4
5
5
# TRAVIS variables
6
6
TRAVIS_AVAILABLE_TIME
@@ -11,6 +11,7 @@ TRAVIS_PULL_REQUEST
11
11
TRAVIS_OS_NAME
12
12
TRAVIS_CONFIG
13
13
TRAVIS
14
+ RUN_FLAKY_TESTS
14
15
15
16
# CTEST
16
17
LD_PRELOAD = /lib/x86_64-linux-gnu/libSegFault.so
Original file line number Diff line number Diff line change 16
16
17
17
set -e
18
18
19
+ echo " Running flaky test: ${RUN_FLAKY_TESTS} "
20
+
19
21
# build QGIS in docker
20
22
echo " travis_fold:start:docker_build_qgis"
21
23
echo " ${bold} Docker build QGIS${endbold} "
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+
3
+ import sys
4
+ import json
5
+ from urllib .request import urlopen # using urllib since it is a standard module (vs. requests)
6
+ from urllib .error import URLError
7
+ import argparse
8
+
9
+ parser = argparse .ArgumentParser (description = 'Determines if a pull request has a defined label' )
10
+ parser .add_argument ('pull_request' , type = int ,
11
+ help = 'pull request id' )
12
+ parser .add_argument ('label' , type = int ,
13
+ help = 'label ID' )
14
+
15
+ args = parser .parse_args ()
16
+
17
+ url = "https://api.github.com/repos/qgis/QGIS/pulls/{}" .format (args .pull_request )
18
+
19
+ try :
20
+ data = urlopen (url ).read ().decode ('utf-8' )
21
+ except URLError as err :
22
+ print ("URLError: " .format (err .reason ))
23
+ sys .exit (1 )
24
+
25
+ obj = json .loads (data )
26
+
27
+ for label in obj ['labels' ]:
28
+ if label ["id" ] == args .label :
29
+ print ("true" )
30
+ sys .exit (0 )
31
+
32
+ print ("label not found" )
33
+ sys .exit (1 )
Original file line number Diff line number Diff line change 11
11
- ${HOME}/.ccache_docker_build_cosmic
12
12
- ${HOME}/.ccache_docker_build_bionic
13
13
timeout : 1000
14
- if : NOT branch =~ /^(cherry-pick-)?backport-\d+-on-/ AND NOT branch =~ /-patch-\d+$/
14
+ if : NOT branch =~ /^(cherry-pick-)?backport-\d+-on-/ AND NOT branch =~ /-patch-\d+$/
15
15
16
16
env :
17
17
global :
@@ -46,6 +46,8 @@ matrix:
46
46
- CCACHE_DIR=${HOME}/.ccache_testing
47
47
- DOCKER_TAG=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && echo $TRAVIS_BRANCH | sed 's/master/latest/' || echo "latest" )
48
48
- DOCKER_BUILD_DEPS_FILE=qgis3-build-deps.dockerfile
49
+ # Label ID can be found here https://api.github.com/repos/qgis/QGIS/labels
50
+ - RUN_FLAKY_TESTS=$(.ci/travis/scripts/pr_has_label.py $TRAVIS_PULL_REQUEST 1271248184)
49
51
50
52
# #########################################################
51
53
# CODE LAYOUT
Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ namespace QgsTest
83
83
{
84
84
return qgetenv ( " TRAVIS" ) == QStringLiteral ( " true" );
85
85
}
86
+
87
+ bool runFlakyTests ()
88
+ {
89
+ return qgetenv ( " RUN_FLAKY_TESTS" ) == QStringLiteral ( " true" );
90
+ }
86
91
}
87
92
88
93
#endif // QGSTEST_H
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ void TestQgsOgrProvider::testThread()
187
187
// Disabled by @m-kuhn
188
188
// This test is flaky
189
189
// See https://travis-ci.org/qgis/QGIS/jobs/505008602#L6464-L7108
190
- if ( QgsTest::isTravis () )
190
+ if ( ! QgsTest::runFlakyTests () )
191
191
QSKIP ( " This test is disabled on Travis CI environment" );
192
192
193
193
// After reading a QgsVectorLayer (getFeatures) from another thread the QgsOgrConnPoolGroup starts
You can’t perform that action at this time.
0 commit comments