diff --git a/.github/workflows/python-ci-tests.yml b/.github/workflows/python-ci-tests.yml index 2dc51d85..4bc4e3d8 100644 --- a/.github/workflows/python-ci-tests.yml +++ b/.github/workflows/python-ci-tests.yml @@ -6,7 +6,7 @@ on: [push, pull_request] env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres + POSTGRES_DB: stix jobs: test-job: @@ -14,7 +14,7 @@ jobs: services: postgres: - image: postgres:11 + image: postgres # Provide the password for postgres env: POSTGRES_USER: postgres @@ -34,9 +34,9 @@ jobs: name: Python ${{ matrix.python-version }} Build steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4.2.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5.4.0 with: python-version: ${{ matrix.python-version }} - name: Install and update essential dependencies @@ -48,7 +48,7 @@ jobs: run: | tox - name: Upload coverage information to Codecov - uses: codecov/codecov-action@v4.2.0 + uses: codecov/codecov-action@v5.4.0 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false # optional (default = false) diff --git a/stix2/test/v21/test_datastore_relational_db.py b/stix2/test/v21/test_datastore_relational_db.py index 9a3e9207..518ef307 100644 --- a/stix2/test/v21/test_datastore_relational_db.py +++ b/stix2/test/v21/test_datastore_relational_db.py @@ -15,7 +15,7 @@ import stix2.registry import stix2.v21 -_DB_CONNECT_URL = f"postgresql://{os.getenv('POSTGRES_USER', 'postgres')}:{os.getenv('POSTGRES_PASSWORD', 'postgres')}@0.0.0.0:5432/postgres" +_DB_CONNECT_URL = f"postgresql://{os.getenv('POSTGRES_USER', 'postgres')}:{os.getenv('POSTGRES_PASSWORD', 'postgres')}@0.0.0.0:5432/{os.getenv('POSTGRES_DB', 'postgres')}" store = RelationalDBStore( PostgresBackend(_DB_CONNECT_URL, True), diff --git a/tox.ini b/tox.ini index 5b160a7c..6c0960fd 100644 --- a/tox.ini +++ b/tox.ini @@ -3,22 +3,22 @@ envlist = py38,py39,py310,py311,py312,packaging,pre-commit-check [testenv] deps = - tox pytest pytest-cov coverage - taxii2-client - rapidfuzz - haversine medallion - sqlalchemy - sqlalchemy_utils - psycopg2 + +extras = + taxii + semantic + relationaldb commands = python -m pytest --cov=stix2 stix2/test/ --cov-report term-missing -W ignore::stix2.exceptions.STIXDeprecationWarning -passenv = GITHUB_* +passenv = + GITHUB_* + POSTGRES_* [testenv:packaging] deps =