From 74dea44947a2eeb8a948c3ea47260e1590e5777d Mon Sep 17 00:00:00 2001 From: Pawel Polewicz Date: Thu, 21 May 2026 22:12:03 +0000 Subject: [PATCH 1/3] Run CLI compatibility tests in CI --- .github/workflows/ci.yml | 55 +++++++++++++++++++++++ changelog.d/+cli-compat.infrastructure.md | 1 + 2 files changed, 56 insertions(+) create mode 100644 changelog.d/+cli-compat.infrastructure.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10da809a..ace4ac3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,6 +139,61 @@ jobs: - name: Run integration tests if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} run: uv run nox -vs integration -- --dont-cleanup-old-buckets -v + cli-compat: + timeout-minutes: 90 + needs: cleanup_buckets + env: + B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }} + B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }} + INSTALL_SDK_FROM: ../b2-sdk-python + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + python-version: "3.10" + - os: ubuntu-latest + python-version: "3.14" + - os: macos-latest + python-version: "3.12" + - os: windows-latest + python-version: "3.12" + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + path: b2-sdk-python + - uses: actions/checkout@v4 + with: + repository: Backblaze/B2_Command_Line_Tool + path: B2_Command_Line_Tool + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + - uses: astral-sh/setup-uv@v7 + with: + version: ${{ env.UV_VERSION }} + enable-cache: true + - name: Install test binary dependencies + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get -y update + sudo apt-get -y install zsh fish + sudo chmod -R 755 /usr/share/zsh/vendor-completions /usr/share/zsh + - name: Install test binary dependencies (macOS) + if: startsWith(matrix.os, 'macos') + run: brew install fish + - name: Install dependencies + run: uv sync --directory ./B2_Command_Line_Tool --locked --group nox + - name: Run CLI unit tests + run: uv run --directory ./B2_Command_Line_Tool nox -vs unit -p ${{ matrix.python-version }} + - name: Run CLI integration tests (without secrets) + run: uv run --directory ./B2_Command_Line_Tool nox -vs integration -p ${{ matrix.python-version }} -- -m "not require_secrets" + - name: Run CLI integration tests (with secrets) + if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' }} + run: uv run --directory ./B2_Command_Line_Tool nox -vs integration -p ${{ matrix.python-version }} -- -m "require_secrets" --cleanup doc: timeout-minutes: 30 needs: build diff --git a/changelog.d/+cli-compat.infrastructure.md b/changelog.d/+cli-compat.infrastructure.md new file mode 100644 index 00000000..7be7e94e --- /dev/null +++ b/changelog.d/+cli-compat.infrastructure.md @@ -0,0 +1 @@ +Run B2 CLI unit tests and integration tests in CI against the SDK checkout. From d48054dfe73e7912b597f26d5eb9a0328924997c Mon Sep 17 00:00:00 2001 From: Pawel Polewicz Date: Thu, 21 May 2026 22:19:56 +0000 Subject: [PATCH 2/3] Reduce CLI secret integration load --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ace4ac3f..ac5c8ff6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -193,7 +193,16 @@ jobs: run: uv run --directory ./B2_Command_Line_Tool nox -vs integration -p ${{ matrix.python-version }} -- -m "not require_secrets" - name: Run CLI integration tests (with secrets) if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' }} - run: uv run --directory ./B2_Command_Line_Tool nox -vs integration -p ${{ matrix.python-version }} -- -m "require_secrets" --cleanup + working-directory: B2_Command_Line_Tool + run: | + .nox/integration-3-14/bin/python -m pytest \ + test/integration \ + -n 1 \ + --log-level INFO \ + -W ignore::DeprecationWarning:rst2ansi.visitor: \ + -m "require_secrets" \ + --cleanup \ + --sut .nox/integration-3-14/bin/b2v4 doc: timeout-minutes: 30 needs: build From fb6aa88a2f2617a40ba9e10a8caa058084ae9b0b Mon Sep 17 00:00:00 2001 From: Pawel Polewicz Date: Fri, 22 May 2026 02:36:26 +0000 Subject: [PATCH 3/3] Activate CLI test environment in CI smoke run --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac5c8ff6..e8e7ce08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,14 +195,16 @@ jobs: if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' }} working-directory: B2_Command_Line_Tool run: | - .nox/integration-3-14/bin/python -m pytest \ + export VIRTUAL_ENV="$PWD/.nox/integration-3-14" + export PATH="$VIRTUAL_ENV/bin:$PATH" + python -m pytest \ test/integration \ -n 1 \ --log-level INFO \ -W ignore::DeprecationWarning:rst2ansi.visitor: \ -m "require_secrets" \ --cleanup \ - --sut .nox/integration-3-14/bin/b2v4 + --sut "$VIRTUAL_ENV/bin/b2v4" doc: timeout-minutes: 30 needs: build