Skip to content

Commit

Permalink
Add tox to workflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jopel committed Dec 16, 2024
1 parent 53b95a2 commit ed4b8e6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ jobs:
run: |
pip install "./tests/snowflake-telemetry-test-utils[all]"
pytest
- name: Test with tox
run: |
version="${{ matrix.python-version }}"
version_without_dot="${version//./}"
pip install tox
env TOX_SKIP_ENV='^(?!py'"$version_without_dot"'-)' tox
35 changes: 15 additions & 20 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,47 +1,42 @@
[tox]
envlist = py{38,39,310,311},protobuf-v{3,4,5},no-protobuf,codegen,marshaler
envlist =
py{38,39,310,311,312},
py{38,39,310,311,312}-no-protobuf,
py{38,39,310,311,312}-protobuf-v{3,4,5},
py{38,39,310,311,312}-codegen,
py{38,39,310,311,312}-marshaler

[testenv]
description = Run tests
deps =
.
./tests/snowflake-telemetry-test-utils
commands =
pytest --ignore=tests/test_proto_serialization.py --ignore=tests/test_protoc_plugin.py
pytest --ignore=tests/test_proto_serialization.py --ignore=tests/test_protoc_plugin.py {posargs}

[testenv:protobuf-v{3,4,5}]
[testenv:py{38,39,310,311,312}-no-protobuf]
description = Run tests without protobuf
setenv =
SNOWFLAKE_TELEMETRY_NO_PROTOBUF = 1

[testenv:py{38,39,310,311,312}-protobuf-v{3,4,5}]
description = Run tests with protobuf versions
deps =
.
./tests/snowflake-telemetry-test-utils
v3: protobuf>=3.19,<4
v4: protobuf>=4,<5
v5: protobuf>=5,<6
commands =
pytest --ignore=tests/test_proto_serialization.py --ignore=tests/test_protoc_plugin.py

[testenv:no-protobuf]
description = Run tests without protobuf
setenv =
SNOWFLAKE_TELEMETRY_NO_PROTOBUF = 1
deps =
.
./tests/snowflake-telemetry-test-utils
commands =
pytest --ignore=tests/test_proto_serialization.py --ignore=tests/test_protoc_plugin.py

[testenv:codegen]
[testenv:py{38,39,310,311,312}-codegen]
description = Run codegen tests
deps =
.
./tests/snowflake-telemetry-test-utils[code-gen]
commands =
pytest tests/test_protoc_plugin.py

[testenv:marshaler]
[testenv:py{38,39,310,311,312}-marshaler]
description = Run marshaler tests
deps =
.
./tests/snowflake-telemetry-test-utils
commands =
pytest tests/test_proto_serialization.py

0 comments on commit ed4b8e6

Please sign in to comment.