Skip to content

changed import of setup_logging from utils to client.logs #13

changed import of setup_logging from utils to client.logs

changed import of setup_logging from utils to client.logs #13

Workflow file for this run

name: Run Pytests
on:
push:
paths:
- '**.py'
- '**.yaml'
- '**.yml'
- '**.toml'
pull_request:
types:
- opened
- synchronize
- reopened
paths:
- '**.py'
- '**.yaml'
- '**.yml'
- '**.toml'
defaults:
run:
shell: bash
env:
LANG: en_US.utf-8
LC_ALL: en_US.utf-8
PYTHON_VERSION: '3.10'
PROJECT_NAME: volttron-postgresql-historian
PGPASSWORD: 'postgres'
jobs:
run-tests:
strategy:
matrix:
os: [ "ubuntu-22.04" ]
python: [ "3.10", "3.11" ]
runs-on: ${{ matrix.os }}
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
id: setup-python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#------------------
# setup database
#----------------
- run: |
psql -h localhost -U postgres -c "CREATE DATABASE test_historian;"
psql -h localhost -U postgres -c "CREATE USER historian with encrypted password 'historian';"
psql -h localhost -U postgres -c "GRANT ALL PRIVILEGES on database test_historian to historian;"
#----------------------------------------------
# install your root project, and run tests.
#----------------------------------------------
- name: Install library and run tests
run: |
poetry install --no-interaction
poetry add --group dev pytest-github-actions-annotate-failures
poetry run pytest tests/test_postgresql_historian_integration.py