From 9aab554891e3e220972bd550179b2ad8ffb503ec Mon Sep 17 00:00:00 2001 From: Krzysztof Kalinowski Date: Tue, 19 Dec 2023 15:10:04 +0400 Subject: [PATCH] Using latest-stable library in bundle tests, instead of the `b2` --- .github/workflows/ci.yml | 2 +- noxfile.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a9d2f9e7..acbd3d3b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -206,7 +206,7 @@ jobs: id: hashes run: nox -vs make_dist_digest - name: Run integration tests (without secrets) - run: nox -vs integration -- -m "not require_secrets" + run: nox -vs integration -- --sut=${{ steps.bundle.outputs.sut_path }} -m "not require_secrets" - name: Run integration tests (with secrets) if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} run: nox -vs integration -- --sut=${{ steps.bundle.outputs.sut_path }} -m "require_secrets" --cleanup diff --git a/noxfile.py b/noxfile.py index 7baf4f4da..07bd31c93 100644 --- a/noxfile.py +++ b/noxfile.py @@ -341,10 +341,13 @@ def bundle(session: nox.Session): # otherwise glob won't find files on windows in action-gh-release. print('asset_path=dist/*') - # Pick only the shortest named executable. - # All the longer ones should be for different versions, the shortest one will be the latest stable. - executable = min( - [str(path) for path in pathlib.Path('dist').glob('*')], key=lambda path: len(path) + # Note: this should pick the shortest named executable from the directory. + # But, for yet unknown reason, the `./dist/b2` doesn't play well with `--sut` and the autocomplete. + # For this reason, we're returning here the "latest, stable version" instead. + # This current implementation works fine up until version 10, when it will break. + # By that time, we should have come back to picking the shortest named binary (`b2`) up. + executable = max( + str(path) for path in pathlib.Path('dist').glob('*') if not path.name.startswith('_') ) print(f'sut_path={executable}')