Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor nmdc_automation unit tests and add basic CI #34

Merged
merged 67 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
169d51c
first attempt to fix imports
mbthornton-lbl Nov 29, 2023
fa232da
Migrate 3 file metadata unit tests to top-level tests dir and pytest
mbthornton-lbl Dec 1, 2023
45bb536
refactor some jgi_file_staging tests to pytest and top-level tests di…
mbthornton-lbl Dec 6, 2023
b9bde13
Create blt.yml
mbthornton-lbl Dec 6, 2023
622d45b
Update blt.yml
mbthornton-lbl Dec 6, 2023
8037c69
Add Flake8 reqs to project
mbthornton-lbl Dec 6, 2023
b420c5e
Update blt.yml
mbthornton-lbl Dec 6, 2023
4beaee4
Update blt.yml
mbthornton-lbl Dec 6, 2023
79ac28c
Update blt.yml
mbthornton-lbl Dec 6, 2023
116f0bf
Merge branch 'Refactor_fgi_file_staging_unit_tests' of https://github…
mbthornton-lbl Dec 6, 2023
8991844
update to BLT
mbthornton-lbl Dec 6, 2023
9ad42ee
increase mongo service retries
mbthornton-lbl Dec 6, 2023
bbb8888
remove redundant build directives
mbthornton-lbl Dec 7, 2023
1c17e71
add mongo env values
mbthornton-lbl Dec 7, 2023
75368c5
move mongo service to build
mbthornton-lbl Dec 7, 2023
d50cfd3
update yml
mbthornton-lbl Dec 7, 2023
57776f1
re-consolidate to one job
mbthornton-lbl Dec 7, 2023
370fc34
try DigiPie mongo-action
mbthornton-lbl Dec 7, 2023
280f1ad
correct typo
mbthornton-lbl Dec 7, 2023
da04342
explicit dir target for pytests to exclude sub-package tests
mbthornton-lbl Dec 7, 2023
2009934
invoke docker run to set up mongodb
mbthornton-lbl Dec 7, 2023
8e86360
set username and password
mbthornton-lbl Dec 7, 2023
5f1d975
add --auth flag
mbthornton-lbl Dec 7, 2023
e44fc5b
try with no env vars set
mbthornton-lbl Dec 7, 2023
f3f90d3
cleanup
mbthornton-lbl Dec 7, 2023
fcd31a5
set mongo env vars
mbthornton-lbl Dec 7, 2023
8b881fd
update db name to test
mbthornton-lbl Dec 7, 2023
28f5b43
try disabling reset_db
mbthornton-lbl Dec 7, 2023
8287dd2
nope that didn't work
mbthornton-lbl Dec 7, 2023
60694c2
re-set --auth
mbthornton-lbl Dec 7, 2023
815dfdd
try supercharge mongo GHA
mbthornton-lbl Dec 7, 2023
fb939ea
correct supercharge version
mbthornton-lbl Dec 7, 2023
107fe22
add health check step
mbthornton-lbl Dec 7, 2023
b95fc6b
healthcheck
mbthornton-lbl Dec 7, 2023
9819d7d
health-check timeout
mbthornton-lbl Dec 7, 2023
ace63a8
spin up basic mongo no env vars
mbthornton-lbl Dec 7, 2023
7d10d11
add FIXTURES_DIR and test data fixture
mbthornton-lbl Dec 7, 2023
512df73
add missing fixture
mbthornton-lbl Dec 7, 2023
cd8f487
omics processing fixture
mbthornton-lbl Dec 7, 2023
8f9831b
add more missing test fixtures
mbthornton-lbl Dec 7, 2023
66f9098
fix filename
mbthornton-lbl Dec 7, 2023
61b652d
add test fixture
mbthornton-lbl Dec 7, 2023
d2b3d21
missing test fixture
mbthornton-lbl Dec 7, 2023
10bd61b
comment out 1 failing assertion in test_activities.py
mbthornton-lbl Dec 7, 2023
99f9eb8
comment out more failed assertions in test_activities.py
mbthornton-lbl Dec 7, 2023
f7b0dd1
add coverage and comment out unit tests with fixture data / Sample mo…
mbthornton-lbl Dec 8, 2023
cceeb9e
add coverage reporting step
mbthornton-lbl Dec 8, 2023
786a1da
fix test output paths
mbthornton-lbl Dec 8, 2023
3dc8ac3
add coverage report placeholders to README
mbthornton-lbl Dec 8, 2023
2c57b5f
add test status badge to readme
mbthornton-lbl Dec 8, 2023
48233c0
disable pytest coverage comment
mbthornton-lbl Dec 8, 2023
300e9ea
disable html output on push
mbthornton-lbl Dec 8, 2023
2e09956
add flake8 Linting step and genbadge requirements
mbthornton-lbl Dec 8, 2023
f5913d8
fix flake8 command
mbthornton-lbl Dec 8, 2023
083db08
genbadge tests
mbthornton-lbl Dec 8, 2023
3535afa
install genbadge[all with pip
mbthornton-lbl Dec 8, 2023
7edb595
remove generate badges and requirements
mbthornton-lbl Dec 8, 2023
0820ebd
add coverage comment
mbthornton-lbl Dec 8, 2023
8223205
add local badgers
mbthornton-lbl Dec 8, 2023
8b91023
update name
mbthornton-lbl Dec 8, 2023
4608e8d
name
mbthornton-lbl Dec 8, 2023
428c497
update readme badgers
mbthornton-lbl Dec 8, 2023
ed7a4ce
Delete redundant unit tests - tests are replicated in test_file_metadata
mbthornton-lbl Dec 8, 2023
ebbfc54
delete redundant unite test
mbthornton-lbl Dec 11, 2023
f3afde9
set branches to *
mbthornton-lbl Dec 11, 2023
15c7773
try again all branches
mbthornton-lbl Dec 11, 2023
5dda265
remove branch filters
mbthornton-lbl Dec 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/blt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: CI

on:
push:

permissions:
contents: read

jobs:
build_lint_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup_mongodb
uses: supercharge/[email protected]
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: |
poetry install
- name: Lint with flake8
run: |
poetry run flake8 nmdc_automation --exit-zero --statistics --tee --output-file flake8stats.txt
- name: Test with pytest
run: |
poetry run pytest ./tests --junit-xml=pytest.xml --cov-report=term \
--cov-report=xml --cov=nmdc_automation --local-badge-output-dir badges/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

test:
PYTHONPATH=$(shell pwd) pytest --cov-report term --cov-report html --cov=nmdc_automation ./tests
PYTHONPATH=$(shell pwd) pytest --cov-report term --cov=nmdc_automation ./tests
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[![CI](https://github.com/microbiomedata/nmdc_automation/actions/workflows/blt.yml/badge.svg)](https://github.com/microbiomedata/nmdc_automation/actions/workflows/blt.yml)
![Tests](./badges/tests.svg)
![Coverage](./badges/coverage.svg)


<!-- Pytest Coverage Comment:Begin -->
<!-- Pytest Coverage Comment:End -->

# nmdc_automation

## Goal
Expand Down
50 changes: 50 additions & 0 deletions badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions badges/tests.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading