Skip to content

Commit

Permalink
Merge pull request #34 from microbiomedata/Refactor_fgi_file_staging_…
Browse files Browse the repository at this point in the history
…unit_tests

Refactor nmdc_automation unit tests and add basic CI
  • Loading branch information
Michal Babinski authored Dec 13, 2023
2 parents 4aea7b0 + 5dda265 commit 23a0ace
Show file tree
Hide file tree
Showing 36 changed files with 3,022 additions and 357 deletions.
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

0 comments on commit 23a0ace

Please sign in to comment.