Skip to content

Commit ee925cb

Browse files
authored
Fix test issues and warnings (#17745)
* Fix test issues and warnings * Reduce duration report to 10 tests * Fix regex
1 parent 7eb23ac commit ee925cb

File tree

7 files changed

+9
-14
lines changed

7 files changed

+9
-14
lines changed

.github/actions/test-coverage/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ inputs:
1111
required: true
1212

1313
duration:
14-
description: 'Tests maximum duration'
14+
description: 'Show N slowest test durations (N=0 for all)'
1515
required: true
1616
default: '10'
1717

@@ -30,7 +30,7 @@ runs:
3030
if: ${{ inputs.tests }}
3131
shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }}
3232
run: |
33-
pytest ${{ inputs.tests }} --durations=${{ inputs.duration }} -n ${{ inputs.workers }} ${{ github.ref == 'refs/heads/develop2' && '--cov=conan --cov=conans --cov=test --cov-report=term-missing:skip-covered' || '' }}
33+
pytest ${{ inputs.tests }} --durations=${{ inputs.duration }} -n ${{ inputs.workers }} ${{ github.ref == 'refs/heads/develop2' && '--cov=conan --cov=conans --cov=test --cov-report=' || '' }}
3434
3535
- name: Rename coverage file
3636
if: github.ref == 'refs/heads/develop2'

.github/workflows/linux-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ jobs:
8888
python-version: ${{ matrix.python-version }}
8989
test-type: ${{ matrix.test-type }}
9090
tests: test/${{ matrix.test-type }}
91-
duration: 20
9291

9392
linux_docker_tests:
9493
needs: build_container
@@ -120,5 +119,4 @@ jobs:
120119
python-version: ${{ matrix.python-version }}
121120
test-type: docker
122121
tests: '-m docker_runner -rs'
123-
duration: 20
124122
workers: 1

.github/workflows/osx-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,3 @@ jobs:
172172
python-version: ${{ matrix.python-version }}
173173
test-type: ${{ matrix.test-type }}
174174
tests: test/${{ matrix.test-type }}
175-
duration: 20

.github/workflows/win-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
python-version: ${{ matrix.python-version }}
5555
test-type: unit-integration
5656
tests: test/unittests test/integration
57-
duration: 100
5857

5958
functional_tests:
6059
runs-on: windows-2022
@@ -249,4 +248,3 @@ jobs:
249248
python-version: ${{ matrix.python-version }}
250249
test-type: functional
251250
tests: test/functional
252-
duration: 100

test/integration/configuration/conf/test_conf_copy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_copy_conaninfo_conf():
1818
assert "tools.deployer:symlinks" in result
1919
assert "user.myconf:cmake-test" in result
2020

21-
pattern = ["tools\..*"]
21+
pattern = [r"tools\..*"]
2222
conf.define("tools.info.package_id:confs", pattern)
2323
result = conf.copy_conaninfo_conf().dumps()
2424
assert "tools.info.package_id:confs=%s" % pattern in result

test/integration/toolchains/microsoft/test_nmakedeps.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ def package_info(self):
4141
bat_file = client.load("conannmakedeps.bat")
4242
# Checking that defines are added to CL
4343
for flag in (
44-
'/D"TEST_DEFINITION1"', '/D"TEST_DEFINITION2#0"',
45-
'/D"TEST_DEFINITION3#"', '/D"TEST_DEFINITION4#"foo""',
46-
'/D"TEST_DEFINITION5#"__declspec\(dllexport\)""',
47-
'/D"TEST_DEFINITION6#"foo bar""',
48-
'/D"TEST_DEFINITION7#7"'
44+
r'/D"TEST_DEFINITION1"', '/D"TEST_DEFINITION2#0"',
45+
r'/D"TEST_DEFINITION3#"', '/D"TEST_DEFINITION4#"foo""',
46+
r'/D"TEST_DEFINITION5#"__declspec\(dllexport\)""',
47+
r'/D"TEST_DEFINITION6#"foo bar""',
48+
r'/D"TEST_DEFINITION7#7"'
4949
):
5050
assert re.search(fr'set "CL=%CL%.*\s{flag}(?:\s|")', bat_file)
5151
# Checking that libs and system libs are added to _LINK_

test/unittests/tools/files_patch_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_patch_strip_delete(self):
9090
class PatchConan(ConanFile):
9191
def source(self):
9292
patch(self, self.source_folder, "example.patch", strip=1)""")
93-
patch = dedent("""
93+
patch = dedent(r"""
9494
--- a\src\oldfile
9595
+++ b/dev/null
9696
@@ -0,1 +0,0 @@

0 commit comments

Comments
 (0)