Skip to content

Commit

Permalink
Merge branch 'master' into fix/wms-provider-url-decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
cioddi authored Jan 3, 2025
2 parents 39c6751 + 6f4df5d commit 2c206b2
Show file tree
Hide file tree
Showing 10,357 changed files with 1,039,961 additions and 775,312 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
96 changes: 53 additions & 43 deletions .ci/ctest2ci.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
***************************************************************************
Expand All @@ -18,51 +17,56 @@
***************************************************************************
"""

__author__ = 'Matthias Kuhn'
__date__ = 'March 2017'
__copyright__ = '(C) 2017, Matthias Kuhn'
__author__ = "Matthias Kuhn"
__date__ = "March 2017"
__copyright__ = "(C) 2017, Matthias Kuhn"

# This script parses output from ctest and injects
#
# - Colors for failing unit tests and test cases
# - Group control sequences to hide uninteresting output by default

import sys
import re
import string
import subprocess
import sys

from termcolor import colored
import string

fold_stack = list()
printable = set(string.printable)


def start_fold(tag):
sys.stdout.write('::group::{}\n'.format(tag))
sys.stdout.write(f"::group::{tag}\n")
fold_stack.append(tag)


def end_fold():
try:
tag = fold_stack.pop()
sys.stdout.write('::endgroup::\n')
sys.stdout.write("::endgroup::\n")
except IndexError:
updated_line = colored("======================", 'magenta')
updated_line += colored("ctest2ci error when processing the following line:", 'magenta')
updated_line += colored("----------------------", 'magenta')
updated_line += colored(updated_line, 'magenta')
updated_line += colored("----------------------", 'magenta')
updated_line += colored("Tried to end fold, but fold was never started.", 'magenta')
updated_line += colored("======================", 'magenta')
updated_line = colored("======================", "magenta")
updated_line += colored(
"ctest2ci error when processing the following line:", "magenta"
)
updated_line += colored("----------------------", "magenta")
updated_line += colored(updated_line, "magenta")
updated_line += colored("----------------------", "magenta")
updated_line += colored(
"Tried to end fold, but fold was never started.", "magenta"
)
updated_line += colored("======================", "magenta")


test_count = 0


def start_test_fold():
global test_count
sys.stdout.write('Running tests\n')
start_fold('test.{}'.format(test_count))
sys.stdout.write("Running tests\n")
start_fold(f"test.{test_count}")
test_count += 1


Expand All @@ -72,55 +76,61 @@ def start_test_fold():
p = subprocess.Popen(sys.argv[1:], stdout=subprocess.PIPE)

for line in p.stdout:
updated_line = line.decode('utf-8')
updated_line = line.decode("utf-8")
# remove non printable characters https://stackoverflow.com/a/8689826/1548052
filter(lambda x: x in printable, updated_line)
if re.match('Run dashboard with model Experimental', updated_line):
start_fold('Run tests')
updated_line = '{title}\n{line}'.format(title=colored('Running tests...', 'yellow', attrs=['bold']),
line=updated_line)

elif re.match('Test project /home/runner/QGIS/QGIS/build', updated_line):
if re.match("Run dashboard with model Experimental", updated_line):
start_fold("Run tests")
updated_line = "{title}\n{line}".format(
title=colored("Running tests...", "yellow", attrs=["bold"]),
line=updated_line,
)

elif re.match("Test project /home/runner/QGIS/QGIS/build", updated_line):
end_fold() # tag=Run tests
start_test_fold()

if re.search(r'\*\*\*Failed', updated_line) or re.search(r'\*\*\*Timeout', updated_line):
if re.search(r"\*\*\*Failed", updated_line) or re.search(
r"\*\*\*Timeout", updated_line
):
end_fold()
updated_line = colored(updated_line, 'red')
updated_line = colored(updated_line, "red")
in_failing_test = True

if in_failing_test:
if re.match(' Start', updated_line):
if re.match(" Start", updated_line):
start_test_fold()
in_failing_test = False
elif in_failure:
if re.match('PASS', updated_line) or re.match('Ran', updated_line):
if re.match("PASS", updated_line) or re.match("Ran", updated_line):
in_failure = False
else:
updated_line = colored(updated_line, 'yellow')
elif re.search(r'\*\*\* Segmentation fault', updated_line):
start_fold('segfault')
updated_line = colored(updated_line, 'magenta')
elif re.match(' Test failed: Segmentation fault', updated_line):
updated_line = colored(updated_line, "yellow")
elif re.search(r"\*\*\* Segmentation fault", updated_line):
start_fold("segfault")
updated_line = colored(updated_line, "magenta")
elif re.match(" Test failed: Segmentation fault", updated_line):
end_fold()

else:
if re.match(r'(FAIL|ERROR)[:\!].*', updated_line):
updated_line = colored(updated_line, 'yellow')
if re.match(r"(FAIL|ERROR)[:\!].*", updated_line):
updated_line = colored(updated_line, "yellow")
in_failure = True

if not in_failing_test and re.search('[0-9]+% tests passed, [0-9]+ tests failed out of', updated_line):
tests_failing = re.match(r'.* ([0-9]+) tests failed', updated_line).group(1)
if not in_failing_test and re.search(
"[0-9]+% tests passed, [0-9]+ tests failed out of", updated_line
):
tests_failing = re.match(r".* ([0-9]+) tests failed", updated_line).group(1)
# updated_line += '\n::set-output name=TESTS_FAILING::{}'.format(tests_failing)
end_fold()

if re.search('100% tests passed', updated_line):
updated_line = colored(updated_line, 'green')
if re.search("100% tests passed", updated_line):
updated_line = colored(updated_line, "green")

if re.match('Submit files', updated_line):
start_fold('submit')
elif re.search('Test results submitted to', updated_line):
cdash_url = re.match(r'.*(http.*)$', updated_line).group(1)
if re.match("Submit files", updated_line):
start_fold("submit")
elif re.search("Test results submitted to", updated_line):
cdash_url = re.match(r".*(http.*)$", updated_line).group(1)
# updated_line += '\n::set-output name=CDASH_URL::{}'.format(cdash_url)
end_fold()

Expand Down
4 changes: 3 additions & 1 deletion .ci/ogc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ ccache -M 2.0G
# export CCACHE_LOGFILE=/tmp/cache.debug
ccache -z

# To make ccache work properly with precompiled headers
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime

cmake -GNinja \
-DUSE_CCACHE=ON \
-DWITH_QUICK=OFF \
-DWITH_3D=OFF \
-DWITH_STAGED_PLUGINS=OFF \
-DWITH_GRASS=OFF \
-DSUPPRESS_QT_WARNINGS=ON \
-DENABLE_MODELTEST=OFF \
-DENABLE_PGTEST=OFF \
-DENABLE_MSSQLTEST=OFF \
Expand Down
29 changes: 16 additions & 13 deletions .ci/pr_has_label.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
#!/usr/bin/env python3

import sys
import argparse
import json
from urllib.request import urlopen # using urllib since it is a standard module (vs. requests)
import sys

from urllib.error import URLError
import argparse
from urllib.request import ( # using urllib since it is a standard module (vs. requests)
urlopen,
)

parser = argparse.ArgumentParser(description='Determines if a pull request has a defined label')
parser.add_argument('pull_request', type=str,
help='pull request id')
parser.add_argument('label', type=int,
help='label ID')
parser = argparse.ArgumentParser(
description="Determines if a pull request has a defined label"
)
parser.add_argument("pull_request", type=str, help="pull request id")
parser.add_argument("label", type=int, help="label ID")

args = parser.parse_args()

if args.pull_request == 'false':
if args.pull_request == "false":
print("false")
sys.exit(1)

url = "https://api.github.com/repos/qgis/QGIS/pulls/{}".format(args.pull_request)
url = f"https://api.github.com/repos/qgis/QGIS/pulls/{args.pull_request}"

try:
data = urlopen(url).read().decode('utf-8')
data = urlopen(url).read().decode("utf-8")
except URLError as err:
print("URLError: {}".format(err.reason))
print(f"URLError: {err.reason}")
sys.exit(1)

obj = json.loads(data)

for label in obj['labels']:
for label in obj["labels"]:
if label["id"] == args.label:
print("true")
sys.exit(0)
Expand Down
12 changes: 0 additions & 12 deletions .ci/test_blocklist_qt6.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Qt6 blocklist
test_core_compositionconverter
test_core_expression
test_core_labelingengine
test_core_layoutpicture
# test_core_ogcutils runs fine locally on Fedora:rawhide but not on CI
Expand Down Expand Up @@ -34,41 +33,30 @@ PyQgsProviderConnectionMssql
PyQgsStyleStorageMssql

# To be fixed
PyQgsPythonProvider
PyQgsAnnotation
PyQgsAuthenticationSystem
PyQgsBlockingProcess
PyQgsCodeEditor
PyQgsDelimitedTextProvider
PyQgsEditWidgets
PyQgsElevationProfileCanvas
PyQgsProject
PyQgsFloatingWidget
PyQgsLayoutHtml
PyQgsLineSymbolLayers
PyQgsMapBoxGlStyleConverter
PyQgsMemoryProvider
PyQgsNetworkAccessManager
PyQgsPalLabelingPlacement
PyQgsRasterAttributeTable
PyQgsRasterLayerRenderer
PyQgsShapefileProvider
PyQgsSpatialiteProvider
PyQgsSymbolLayerReadSld
PyQgsVectorLayerEditBuffer
PyQgsVectorLayerEditUtils
PyQgsLayerDefinition
PyQgsSettings
PyQgsSettingsEntry
PyQgsServerApi
PyQgsServerWMSGetFeatureInfo
PyQgsServerWMSGetMap
PyQgsServerAccessControlWFSTransactional
PyQgsServerWFS
ProcessingQgisAlgorithmsTestPt2
ProcessingQgisAlgorithmsTestPt3
ProcessingQgisAlgorithmsTestPt4
ProcessingGdalAlgorithmsVectorTest
ProcessingGrassAlgorithmsImageryTest
# PyQgsProviderRegistry runs fine locally on Fedora:rawhide but not on CI
PyQgsProviderRegistry
Loading

0 comments on commit 2c206b2

Please sign in to comment.