Skip to content

Commit

Permalink
MAINT run a basic smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
htwangtw committed Jul 16, 2024
1 parent 7a88325 commit 20ae9e5
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
on:
push:
branches:
- main
- maint/*
tags:
- '*'
pull_request:
branches:
- main
- maint/*

defaults:
run:
shell: bash


jobs:
lazy-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install build dependencies
run: python -m pip install --upgrade pip
- name: Install task package
run: pip install -e .[test]

- name: Run the tests script as a smoke test.
run: |
python general_class_balancer/tests/random_example_test.py
echo "Got exit code: $?"
exit "$?"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# General Class Balancer

Author: mleming

Maintainer: Hao-Ting Wang

## Description
Expand Down
5 changes: 4 additions & 1 deletion general_class_balancer/tests/random_example_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import numpy as np
from numpy.random import normal as norm
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -94,4 +95,6 @@ def test_all(classes, confounds):
plt.hist(confounds[cnum, classes == 1], bins=bins)
plt.hist(confounds[cnum, classes == 2], bins=bins)

plt.show()
plt.savefig("test_data.png")

sys.exit()

0 comments on commit 20ae9e5

Please sign in to comment.