Skip to content

Commit

Permalink
Remove Travis, add GH Action for Unit Test
Browse files Browse the repository at this point in the history
Change test db to postgres

Adding code coverage

Fix coverage report
  • Loading branch information
k-burt-uch committed Oct 20, 2023
1 parent ea885f0 commit 6147b9b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 102 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/buildpipeline.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
name: CI

on:
push:
push:
pull_request:
types: [opened, reopened]

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true


jobs:
Security:
name: Security Pipeline
uses: uc-cdis/.github/.github/workflows/securitypipeline.yaml@master
with:
python-poetry: 'false'
secrets: inherit

UnitTest:
name: Python Unit Test with Postgres
uses: uc-cdis/.github/.github/workflows/python_unit_test.yaml@master
with:
python-version: '3.9'
test-script: 'tests/ci_commands_script.sh'
run-coveralls: true
ci:
name: Build Image and Push
# TODO Add this line back once we update to Python 3.9 from 3.6
# needs: Security
needs: Security
uses: uc-cdis/.github/.github/workflows/image_build_push.yaml@master
secrets:
ECR_AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
Expand Down
11 changes: 10 additions & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@
"line_number": 17
}
],
".github/workflows/ci.yaml": [
{
"type": "Secret Keyword",
"filename": ".github/workflows/ci.yaml",
"hashed_secret": "3e26d6750975d678acb8fa35a0f69237881576b0",
"is_verified": false,
"line_number": 15
}
],
"deployment/scripts/postgresql/postgresql_init.sql": [
{
"type": "Secret Keyword",
Expand Down Expand Up @@ -386,5 +395,5 @@
}
]
},
"generated_at": "2023-08-08T00:23:28Z"
"generated_at": "2023-09-27T23:07:05Z"
}
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions tests/ci_commands_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

poetry run pytest -vv --cov=fence --cov-report xml tests
2 changes: 1 addition & 1 deletion tests/test-fence-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BASE_URL: 'http://localhost/user'
# postgres db to connect to
# connection url format:
# postgresql://[user[:password]@][netloc][:port][/dbname]
DB: 'postgresql://postgres:postgres@localhost:5432/fence_test_tmp'
DB: 'postgresql://postgres:postgres@localhost:5432/postgres'

# A URL-safe base64-encoded 32-byte key for encrypting keys in db
# in python you can use the following script to generate one:
Expand Down
10 changes: 0 additions & 10 deletions travis/pg_hba.conf

This file was deleted.

32 changes: 0 additions & 32 deletions travis/postgresql.conf

This file was deleted.

0 comments on commit 6147b9b

Please sign in to comment.