Skip to content

Commit

Permalink
Use matrix test to test different liquibase versions (#86)
Browse files Browse the repository at this point in the history
* Use matrix test to test different liquibase versions

* Use matrix test to test different liquibase versions

* Use matrix test to test different liquibase versions

* Use matrix test to test different liquibase versions

* Use matrix test to test different liquibase versions

* Use matrix test to test different liquibase versions
  • Loading branch information
ismailsimsek authored Nov 15, 2024
1 parent 85894b6 commit e7d2575
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
pull_request:
branches: [ master ]
paths-ignore:
- '.github/**'
- '.idea/**'
- '.run/**'

Expand All @@ -20,28 +19,24 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
liquibase-version: [ "4.11.0", "4.24.0", "4.30.0" ]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build & Install
liquibase-version: ${{ matrix.liquibase-version }}
- name: Build & Install & Test
env:
TEST_LIQUIBASE_VERSION: ${{ matrix.liquibase-version }}
run: |
python3 --version
python3 -m pip install coverage pylint pytest
python3 -m pip install coverage pylint pytest setuptools
python3 -m compileall -f pyliquibase setup.py
python3 setup.py -q install --user
python3 -m coverage report -m ./pyliquibase/*.py setup.py
python3 -m coverage run --source=./tests/ -m unittest discover -s tests/
python3 -m pylint pyliquibase setup.py
- name: Test with Unittest
run: |
python3 -m coverage run --source=./tests/ -m unittest discover -s tests/
python3 setup.py -q install --user
bash tests/test_pyliquibase_version.sh
cd tests
pyliquibase --defaultsFile=resources/liquibase.properties updateSQL
10 changes: 6 additions & 4 deletions tests/test_pyliquibase.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ def test_update(self):
self.assertTrue(True)

def test_exception(self):
lb = Pyliquibase(
defaultsFile=os.path.dirname(os.path.realpath(__file__)) + "/resources/liquibase-fail.properties")
lb = Pyliquibase(version=self.TEST_LIQUIBASE_VERSION,
defaultsFile=os.path.dirname(os.path.realpath(__file__)) + "/resources/liquibase-fail.properties")
try:
lb.status()
except Exception as e:
self.assertTrue("Liquibase execution failed" in str(e))

def test_download_additional_java_library(self):
lb = Pyliquibase(defaultsFile=os.path.dirname(os.path.realpath(__file__)) + "/resources/liquibase.properties")
lb = Pyliquibase(version=self.TEST_LIQUIBASE_VERSION,
defaultsFile=os.path.dirname(os.path.realpath(__file__)) + "/resources/liquibase.properties")
lb.download_additional_java_library(url="https://github.com/liquibase/liquibase-snowflake/releases/download/liquibase-snowflake-4.11.0/liquibase-snowflake-4.11.0.jar")
# test re downloading succeeds
lb.download_additional_java_library(url="https://github.com/liquibase/liquibase-snowflake/releases/download/liquibase-snowflake-4.11.0/liquibase-snowflake-4.11.0.jar")
Expand All @@ -63,7 +64,8 @@ def test_download_additional_java_library(self):
lb.download_additional_java_library(url="https://repo1.maven.org/maven2/net/snowflake/snowflake-jdbc/3.13.33/snowflake-jdbc-3.13.33.jar")

def test_download_additional_zip_library(self):
lb = Pyliquibase(defaultsFile=os.path.dirname(os.path.realpath(__file__)) + "/resources/liquibase.properties")
lb = Pyliquibase(version=self.TEST_LIQUIBASE_VERSION,
defaultsFile=os.path.dirname(os.path.realpath(__file__)) + "/resources/liquibase.properties")
# download Bigquery jdbc
lb.download_additional_java_library(
url="https://storage.googleapis.com/simba-bq-release/jdbc/SimbaJDBCDriverforGoogleBigQuery42_1.3.3.1004.zip")
Expand Down
10 changes: 0 additions & 10 deletions tests/test_pyliquibase_version.sh

This file was deleted.

0 comments on commit e7d2575

Please sign in to comment.