Skip to content

Commit

Permalink
reduce running get bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenyuLInx committed Dec 15, 2023
1 parent 37385fa commit d32359b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dbt-snowflake~=1.6.0
dbt-bigquery~=1.6.0
dbt-redshift~=1.6.0
dbt-postgres~=1.6.0
dbt-spark[PyHive,ODBC]~=1.6.0
dbt-spark[PyHive,ODBC]~=1.6.2
dbt-databricks~=1.6.0
dbt-trino~=1.6.0
dbt-fabric==1.6.0
Expand Down
13 changes: 9 additions & 4 deletions test/integration/bundle/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
import zipfile


@pytest.mark.parametrize("python_version", [sys.version_info])
@pytest.mark.parametrize(
argnames="test_version",
argvalues=["0.0.0", "1.3.0", "1.4.0", "1.5.0", "1.6.0", "1.7.0b1", "1.7.0"],
)
def test_generate_bundle_creates_a_bundle_with_valid_version(test_version, python_version):
if python_version >= (3, 11) and Version.coerce(test_version) < Version.coerce("1.5.0"):
def test_generate_bundle_creates_a_bundle_with_valid_version(
test_version
):
if sys.version_info >= (3, 11) and Version.coerce(test_version) < Version.coerce(
"1.5.0"
):
pytest.skip("Python 3.11+ requires at least version 1.5.0 of the bundle")
if python_version == (3, 10) and Version.coerce(test_version) >= Version.coerce("1.5.0"):
if sys.version_info == (3, 10) and Version.coerce(test_version) >= Version.coerce(
"1.5.0"
):
pytest.skip("We run test for Python 3.11 with version 1.5.0+ of the bundle")
created_assets = generate_bundle(Version.coerce(test_version))
for asset_name, asset_location in created_assets.items():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import sys
import platform

import pytest
from semantic_version import Version

Expand All @@ -6,6 +9,10 @@

@pytest.mark.parametrize("version", ["1.2.0b1", "1.4.0pre", "1.2.0", "1.3.0a1"])
def test_get_latest_bundle_release_gets_latest_release(version):
if platform.system() == "Darwin" and sys.version_info <= (3, 11):
pytest.skip("Only test for Python 3.11 on macOS")
if platform.system() == "Linux" and sys.version_info not in [(3, 8), (3.11)]:
pytest.skip("Only test for Python 3.8 and 3.11 on Linux")
input_version = Version.coerce(version)
latest_version, is_draft, latest_release = get_latest_bundle_release(str(input_version))
assert (not input_version.prerelease) == (not latest_version.prerelease)
Expand Down

0 comments on commit d32359b

Please sign in to comment.