Skip to content

Commit 128dbab

Browse files
authored
Merge pull request #575 from Backblaze/pr-260-cli-compat
Run CLI tests in CI
2 parents ea55e45 + fb6aa88 commit 128dbab

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,72 @@ jobs:
139139
- name: Run integration tests
140140
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }}
141141
run: uv run nox -vs integration -- --dont-cleanup-old-buckets -v
142+
cli-compat:
143+
timeout-minutes: 90
144+
needs: cleanup_buckets
145+
env:
146+
B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }}
147+
B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }}
148+
INSTALL_SDK_FROM: ../b2-sdk-python
149+
runs-on: ${{ matrix.os }}
150+
strategy:
151+
fail-fast: false
152+
matrix:
153+
include:
154+
- os: ubuntu-latest
155+
python-version: "3.10"
156+
- os: ubuntu-latest
157+
python-version: "3.14"
158+
- os: macos-latest
159+
python-version: "3.12"
160+
- os: windows-latest
161+
python-version: "3.12"
162+
steps:
163+
- uses: actions/checkout@v4
164+
with:
165+
fetch-depth: 0
166+
path: b2-sdk-python
167+
- uses: actions/checkout@v4
168+
with:
169+
repository: Backblaze/B2_Command_Line_Tool
170+
path: B2_Command_Line_Tool
171+
- name: Set up Python ${{ matrix.python-version }}
172+
uses: actions/setup-python@v6
173+
with:
174+
python-version: ${{ matrix.python-version }}
175+
- uses: astral-sh/setup-uv@v7
176+
with:
177+
version: ${{ env.UV_VERSION }}
178+
enable-cache: true
179+
- name: Install test binary dependencies
180+
if: startsWith(matrix.os, 'ubuntu')
181+
run: |
182+
sudo apt-get -y update
183+
sudo apt-get -y install zsh fish
184+
sudo chmod -R 755 /usr/share/zsh/vendor-completions /usr/share/zsh
185+
- name: Install test binary dependencies (macOS)
186+
if: startsWith(matrix.os, 'macos')
187+
run: brew install fish
188+
- name: Install dependencies
189+
run: uv sync --directory ./B2_Command_Line_Tool --locked --group nox
190+
- name: Run CLI unit tests
191+
run: uv run --directory ./B2_Command_Line_Tool nox -vs unit -p ${{ matrix.python-version }}
192+
- name: Run CLI integration tests (without secrets)
193+
run: uv run --directory ./B2_Command_Line_Tool nox -vs integration -p ${{ matrix.python-version }} -- -m "not require_secrets"
194+
- name: Run CLI integration tests (with secrets)
195+
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' }}
196+
working-directory: B2_Command_Line_Tool
197+
run: |
198+
export VIRTUAL_ENV="$PWD/.nox/integration-3-14"
199+
export PATH="$VIRTUAL_ENV/bin:$PATH"
200+
python -m pytest \
201+
test/integration \
202+
-n 1 \
203+
--log-level INFO \
204+
-W ignore::DeprecationWarning:rst2ansi.visitor: \
205+
-m "require_secrets" \
206+
--cleanup \
207+
--sut "$VIRTUAL_ENV/bin/b2v4"
142208
doc:
143209
timeout-minutes: 30
144210
needs: build
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Run B2 CLI unit tests and integration tests in CI against the SDK checkout.

0 commit comments

Comments
 (0)