Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark2000 committed Sep 30, 2024
1 parent ed50428 commit d5cb430
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 10 deletions.
53 changes: 43 additions & 10 deletions .github/workflows/commit_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@ name: Commit Checks
on: [pull_request]

jobs:
Black:
formatting:
name: Linting and Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: psf/black@stable
Ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: isort/isort-action@v1

check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
Expand All @@ -40,6 +34,45 @@ jobs:
excludeTitle: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GITHUB_TOKEN }}

run-pytest:
name: Run Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Find artifact run
run: |
sudo apt-get install jq
export RUN_ID=$( \
curl -L \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/AVSLab/basilisk/actions/runs?status=completed&per_page=100" \
| jq -r '.workflow_runs[] | select(.name == "Pull Request Closed") | .id' | head -n 1 \
)
echo "RUN_ID=$RUN_ID" >> $GITHUB_ENV
- name: Pull artifacts
uses: actions/download-artifact@v4
with:
name: basilisk-wheels_ubuntu-latest_python${{ matrix.python-version }}
repository: AVSLab/basilisk
run-id: ${{ env.RUN_ID }}
github-token: ${{ github.token }}
- name: Install Basilisk from wheels
run: pip install Basilisk*.whl
- name: Install BSK-RL
run: pip install -e '.[all]' && finish_install
- name: Run pytest
run: pytest -v

check-doc-build:
name: Test Documentation Build
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/sats/test_int_satellites.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import gymnasium as gym
import numpy as np
import pytest
from pytest import approx

from bsk_rl import act, data, obs, sats
Expand Down Expand Up @@ -35,6 +36,7 @@ class ImageSat(sats.ImagingSatellite):
disable_env_checker=True,
)

@pytest.mark.skip(reason="Causes tests to hang sometimes")
def test_generate_more_windows(self):
self.env.reset()
dts = []
Expand Down

0 comments on commit d5cb430

Please sign in to comment.