Skip to content

Commit

Permalink
fix: dev: mark slow tests linux-only to run in GH ci
Browse files Browse the repository at this point in the history
* make sure debuild can see new (python) package name
* enhance the deb workflow for artifact action v4

Signed-off-by: Steve Arnold <[email protected]>
  • Loading branch information
sarnold committed Apr 6, 2024
1 parent b8eba02 commit 6ad14cb
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/debs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,31 @@ on:
workflow_dispatch:

jobs:
build-debs:
get_version:
name: Get version info
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
outputs:
version: ${{ steps.git_ver.outputs.version }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get package version
id: git_ver
run: |
version=$(git describe --tags | sed -e "s|v||" -e "s|-g|+g|")
echo "Version from git: ${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
build_debs:
name: ${{ matrix.name }}
runs-on: ubuntu-22.04
needs: [get_version]

strategy:
fail-fast: false
Expand All @@ -31,6 +53,12 @@ jobs:
dist: bookworm

steps:
- name: Check github variables
env:
VERSION: ${{ needs.get_version.outputs.version }}
run: |
echo "Package version from git: ${VERSION}"
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand All @@ -39,7 +67,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install devscripts
debchange -v "`git describe --tags | sed -e "s|v||" -e "s|-g|+g|"`-${{ matrix.dist }}" -b -M --distribution ${{ matrix.dist }} "ci build"
debchange -v ${{ needs.get_version.outputs.version }}-${{ matrix.dist }} -b -M --distribution ${{ matrix.dist }} "ci build"
- name: Build deb packages
uses: jtdor/build-deb-action@v1
Expand All @@ -53,5 +81,5 @@ jobs:
- name: Upload deb files
uses: actions/upload-artifact@v4
with:
name: "deb-packages"
name: "bmaptool_${{ needs.get_version.outputs.version }}-${{ matrix.dist }}"
path: ./debian/artifacts/*.deb
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
bmaptool (3.7-2) unstable; urgency=medium

* New upstream maintainer is changing package name

-- Steve Arnold <[email protected]> Fri, 05 Apr 2024 20:05:15 -0700

bmap-tools (3.7-1) unstable; urgency=medium

* New upstream release
Expand Down
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import sys
import pytest


ALL = set("darwin linux win32".split())


def pytest_runtest_setup(item):
supported_platforms = ALL.intersection(mark.name for mark in item.iter_markers())
plat = sys.platform
if supported_platforms and plat not in supported_platforms:
pytest.skip("cannot run on platform {}".format(plat))


def pytest_addoption(parser):
parser.addoption(
"--slow", action="store_true", default=False, help="include slow tests"
Expand Down
1 change: 1 addition & 0 deletions tests/test_api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ class TestCreateCopy(unittest.TestCase):
function for different sparse files.
"""

@pytest.mark.linux
@pytest.mark.slow
def test(self): # pylint: disable=R0201
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_filemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class TestFilemap(unittest.TestCase):
The test class for this unit tests. Basically executes the '_do_test()'
function for different sparse files.
"""

@pytest.mark.linux
@pytest.mark.slow
def test(self): # pylint: disable=R0201
"""
Expand Down

0 comments on commit 6ad14cb

Please sign in to comment.