Skip to content

Commit

Permalink
(fix PPS-629): remove travis, add GH action for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
george42-ctds committed Oct 30, 2023
1 parent 51b6650 commit b1cdee6
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 69 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI
on:
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
71 changes: 41 additions & 30 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
{
"name": "AWSKeyDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"name": "Base64HighEntropyString",
"limit": 4.5
Expand All @@ -17,9 +20,15 @@
{
"name": "CloudantDetector"
},
{
"name": "DiscordBotTokenDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
Expand All @@ -37,15 +46,24 @@
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
Expand All @@ -57,10 +75,6 @@
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_baseline_file",
"filename": ".secrets.baseline"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
Expand Down Expand Up @@ -94,6 +108,15 @@
}
],
"results": {
".github/workflows/ci.yaml": [
{
"type": "Secret Keyword",
"filename": ".github/workflows/ci.yaml",
"hashed_secret": "3e26d6750975d678acb8fa35a0f69237881576b0",
"is_verified": false,
"line_number": 15
}
],
"bin/settings.py": [
{
"type": "Basic Auth Credentials",
Expand All @@ -118,8 +141,7 @@
"filename": "peregrine/dev_settings.example.py",
"hashed_secret": "739155dcfcb1fc7f98aa38d18ea3d2213ae62b54",
"is_verified": false,
"line_number": 62,
"is_secret": false
"line_number": 62
},
{
"type": "Secret Keyword",
Expand All @@ -135,8 +157,7 @@
"filename": "peregrine/dev_settings.py",
"hashed_secret": "739155dcfcb1fc7f98aa38d18ea3d2213ae62b54",
"is_verified": false,
"line_number": 69,
"is_secret": false
"line_number": 69
},
{
"type": "Secret Keyword",
Expand All @@ -152,8 +173,7 @@
"filename": "peregrine/test_settings.py",
"hashed_secret": "27d0f93fe951bda5dc3973ca2a5b420c7dfc387f",
"is_verified": false,
"line_number": 11,
"is_secret": false
"line_number": 11
},
{
"type": "Secret Keyword",
Expand Down Expand Up @@ -183,8 +203,7 @@
"filename": "tests/data/files.json",
"hashed_secret": "d13c66cc793960cb8d97a4d64d1deb6d2288e4fc",
"is_verified": false,
"line_number": 6,
"is_secret": false
"line_number": 6
}
],
"tests/graphql/data/biospec1.json": [
Expand All @@ -193,24 +212,21 @@
"filename": "tests/graphql/data/biospec1.json",
"hashed_secret": "78b4db9b2aec0f0f2d3e38f9278be42b861c9dc3",
"is_verified": false,
"line_number": 63,
"is_secret": false
"line_number": 63
},
{
"type": "Hex High Entropy String",
"filename": "tests/graphql/data/biospec1.json",
"hashed_secret": "e65fd5600e42643c6d77f3c5c3a60114e0d3165d",
"is_verified": false,
"line_number": 72,
"is_secret": false
"line_number": 72
},
{
"type": "Hex High Entropy String",
"filename": "tests/graphql/data/biospec1.json",
"hashed_secret": "922282cd0fad4bf8ca1c93de95863177d57a55c1",
"is_verified": false,
"line_number": 81,
"is_secret": false
"line_number": 81
}
],
"tests/graphql/data/biospec2.json": [
Expand All @@ -219,16 +235,14 @@
"filename": "tests/graphql/data/biospec2.json",
"hashed_secret": "78b4db9b2aec0f0f2d3e38f9278be42b861c9dc3",
"is_verified": false,
"line_number": 18,
"is_secret": false
"line_number": 18
},
{
"type": "Hex High Entropy String",
"filename": "tests/graphql/data/biospec2.json",
"hashed_secret": "e65fd5600e42643c6d77f3c5c3a60114e0d3165d",
"is_verified": false,
"line_number": 27,
"is_secret": false
"line_number": 27
}
],
"tests/graphql/data/databundle1.json": [
Expand All @@ -237,8 +251,7 @@
"filename": "tests/graphql/data/databundle1.json",
"hashed_secret": "b87375c47433817ed4310ab448cda0f74670ee71",
"is_verified": false,
"line_number": 28,
"is_secret": false
"line_number": 28
}
],
"tests/graphql/data/file.json": [
Expand All @@ -247,8 +260,7 @@
"filename": "tests/graphql/data/file.json",
"hashed_secret": "78b4db9b2aec0f0f2d3e38f9278be42b861c9dc3",
"is_verified": false,
"line_number": 9,
"is_secret": false
"line_number": 9
}
],
"tests/graphql/data/submitted_unaligned_reads.json": [
Expand All @@ -257,10 +269,9 @@
"filename": "tests/graphql/data/submitted_unaligned_reads.json",
"hashed_secret": "78b4db9b2aec0f0f2d3e38f9278be42b861c9dc3",
"is_verified": false,
"line_number": 10,
"is_secret": false
"line_number": 10
}
]
},
"generated_at": "2023-05-12T17:31:54Z"
"generated_at": "2023-10-30T20:35:41Z"
}
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

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

# Set up database
poetry run python bin/setup_test_database.py
mkdir -p tests/resources/keys; cd tests/resources/keys; openssl genrsa -out test_private_key.pem 2048; openssl rsa -in test_private_key.pem -pubout -out test_public_key.pem; cd -

# run tests
poetry run pytest -vv --cov=peregrine --cov-report xml tests

0 comments on commit b1cdee6

Please sign in to comment.