From a93214e587335ed01dc872e856412c38d50f2764 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Mon, 1 Nov 2021 10:11:33 -0700 Subject: [PATCH] Add more test logging #3 --- .github/workflows/build.yml | 19 ++++++++++--------- test/integration/__init__.py | 5 +++++ test/integration/test_sdist_cmake.py | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4eecf1b..1dac4ff2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,7 +140,7 @@ jobs: .\setup-x86_64.exe -qgnNdO -R %CYGROOT% -l %CYGCACHE% -s http://mirrors.kernel.org/sourceware/cygwin/ -P cmake,gcc-g++,git,libboost-devel,make,ninja,pkg-config,python38 - -P python38-pip,python38-setuptools + -P python38-pip,python38-setuptools,python38-wheel - name: Copy mopack to Cygwin run: | echo "MOPACK_LIB_NAMES=lib{}.dll.a" >> .mopack_test_env @@ -151,16 +151,17 @@ jobs: C:\cygwin\bin\bash -lc "cd bfg9000 && pip3.8 install ./bfg9000 '.[test]'" - name: Run tests + timeout-minutes: 5 run: > C:\cygwin\bin\bash -lc - "cd bfg9000 && python3.8 setup.py coverage -q && coverage xml" - - name: Copy coverage from Cygwin - run: | - copy C:\cygwin\home\runneradmin\bfg9000\coverage.xml . - - name: Upload coverage - uses: codecov/codecov-action@v2 - with: - files: ./coverage.xml + "cd bfg9000 && python3.8 setup.py test -s test.integration.test_sdist_cmake" + # - name: Copy coverage from Cygwin + # run: | + # copy C:\cygwin\home\runneradmin\bfg9000\coverage.xml . + # - name: Upload coverage + # uses: codecov/codecov-action@v2 + # with: + # files: ./coverage.xml lint: runs-on: ubuntu-latest diff --git a/test/integration/__init__.py b/test/integration/__init__.py index 4787bf44..4d1cfd2b 100644 --- a/test/integration/__init__.py +++ b/test/integration/__init__.py @@ -274,10 +274,15 @@ class IntegrationTest(SubprocessTestCase): deploy = False def setUp(self): + import sys + print('setup 0', file=sys.stderr) self.stage = stage_dir(self.name) + print('setup 1', file=sys.stderr) self.pkgbuilddir = os.path.join(self.stage, 'mopack', 'build') + print('setup 2', file=sys.stderr) if self.deploy: self.prefix = stage_dir(self.name + '-install', chdir=False) + print('setup 3', file=sys.stderr) def assertUsage(self, name, usage='', extra_args=[], *, format='json', submodules=[], extra_env=usage_env, returncode=0): diff --git a/test/integration/test_sdist_cmake.py b/test/integration/test_sdist_cmake.py index c93d19a8..26f639b7 100644 --- a/test/integration/test_sdist_cmake.py +++ b/test/integration/test_sdist_cmake.py @@ -1,5 +1,6 @@ import json import os +import sys from mopack.path import pushd from mopack.platforms import platform_name @@ -12,6 +13,7 @@ class TestInnerCMake(IntegrationTest): deploy = True def test_resolve(self): + print('inner started', file=sys.stderr) config = os.path.join(test_data_dir, 'mopack-inner-cmake.yml') self.assertPopen(['mopack', 'resolve', config, '-Pprefix=' + self.prefix]) @@ -66,16 +68,23 @@ def test_resolve(self): self.assertExists(include_prefix + 'greeter.hpp') self.assertExists(lib_prefix + 'pkgconfig/greeter.pc') self.assertExists('include/hello.hpp') + print('inner DONE', file=sys.stderr) class TestOuterCMake(IntegrationTest): name = 'outer-cmake' deploy = True + def __init__(self, *args, **kwargs): + print('xxx 0', file=sys.stderr) + super().__init__(*args, **kwargs) + def test_resolve(self): + print('xxx 1', file=sys.stderr) config = os.path.join(test_data_dir, 'mopack-outer-cmake.yml') self.assertPopen(['mopack', 'resolve', config, '-Pprefix=' + self.prefix]) + print('xxx 2', file=sys.stderr) self.assertExists('mopack/build/greeter/') self.assertExists('mopack/logs/greeter.log') self.assertExists('mopack/build/hello/') @@ -86,8 +95,10 @@ def test_resolve(self): library_path = [os.path.join(self.pkgbuilddir, 'greeter')] self.assertPathUsage('greeter', include_path=include_path, library_path=library_path, version='1.0') + print('xxx 3', file=sys.stderr) self.assertPkgConfigUsage('hello') + print('xxx 4', file=sys.stderr) output = json.loads(slurp('mopack/mopack.json')) self.assertEqual(output['metadata'], { @@ -123,11 +134,14 @@ def test_resolve(self): ), ], }) + print('xxx 5', file=sys.stderr) self.assertPopen(['mopack', 'deploy']) + print('xxx 6', file=sys.stderr) include_prefix = '' if platform_name() == 'windows' else 'include/' lib_prefix = '' if platform_name() == 'windows' else 'lib/' with pushd(self.prefix): self.assertExists('include/greeter.hpp') self.assertExists(include_prefix + 'hello.hpp') self.assertExists(lib_prefix + 'pkgconfig/hello.pc') + print('xxx 7', file=sys.stderr)