diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index fe95e3d6..cbcd88c4 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -515,6 +515,9 @@ jobs: image_digest: ${{ needs.hubspot_etl_image.outputs.image_digest }} terraform_apply: ${{ needs.determine_stage.outputs.terraform_apply }} secrets: + TF_VAR_db_host: ${{ secrets.DEV_DB_HOST }} + TF_VAR_db_name: ${{ secrets.DEV_DB_NAME }} + TF_VAR_db_port: ${{ secrets.DEV_DB_PORT }} AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} AWS_REGION: ${{ secrets.DEV_AWS_REGION }} diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index a6673c34..740f88f7 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -11,6 +11,21 @@ jobs: name: Tests (Docker) runs-on: ubuntu-latest + services: + postgres: + image: postgres:15 + env: + POSTGRES_USER: test + POSTGRES_PASSWORD: test + POSTGRES_DB: test + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: - name: Checkout code uses: actions/checkout@v4 @@ -21,9 +36,12 @@ jobs: - name: Run tests run: | docker run --rm \ + --network host \ -e EPC_AUTH_TOKEN=${{ secrets.DEV_EPC_AUTH_TOKEN }} \ -e HUBSPOT_API_KEY=${{ secrets.HUBSPOT_API_KEY }} \ - -e DB_HOST=${{ secrets.DEV_DB_HOST }} \ - -e DB_NAME=${{ secrets.DEV_DB_NAME }} \ - -e DB_PORT=${{ secrets.DEV_DB_PORT }} \ + -e DB_HOST=localhost \ + -e DB_NAME=test \ + -e DB_USERNAME=test \ + -e DB_PASSWORD=test \ + -e DB_PORT=5432 \ model-test pytest -vv -m 'not integration' diff --git a/infrastructure/terraform/lambda/_template/variables.tf b/infrastructure/terraform/lambda/_template/variables.tf index e7646811..ae588840 100644 --- a/infrastructure/terraform/lambda/_template/variables.tf +++ b/infrastructure/terraform/lambda/_template/variables.tf @@ -35,3 +35,4 @@ locals { output "resolved_image_uri" { value = local.image_uri } + diff --git a/infrastructure/terraform/lambda/hubspot_deal_etl/variables.tf b/infrastructure/terraform/lambda/hubspot_deal_etl/variables.tf index e7646811..2e7da609 100644 --- a/infrastructure/terraform/lambda/hubspot_deal_etl/variables.tf +++ b/infrastructure/terraform/lambda/hubspot_deal_etl/variables.tf @@ -35,3 +35,16 @@ locals { output "resolved_image_uri" { value = local.image_uri } + + +variable "db_host" { + type = string +} + +variable "db_name" { + type = string +} + +variable "db_port" { + type = string +} \ No newline at end of file