Skip to content

Commit

Permalink
Using latest-stable library in bundle tests, instead of the b2
Browse files Browse the repository at this point in the history
  • Loading branch information
kkalinowski-reef committed Dec 19, 2023
1 parent d22d13f commit 9aab554
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

Expand Down

0 comments on commit 9aab554

Please sign in to comment.