Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .github/workflows/presubmits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ jobs:
validate-signals:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the current repository
- uses: actions/checkout@v4

# Step 2: Check out the central schema repository
- name: Checkout schemas repo
uses: actions/checkout@v4
with:
repository: OBDb/.schemas
path: .schemas

# Step 3: Validate with schema from the central repository
- name: Validate signalsets
id: json-yaml-validate-v3
uses: GrantBirki/[email protected]
Expand Down
65 changes: 42 additions & 23 deletions .github/workflows/response_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,58 @@ on:

permissions:
contents: read
pull-requests: write

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout main repository
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout schemas repo
uses: actions/checkout@v4
- name: Run tests in devcontainer
id: test
uses: devcontainers/[email protected]
with:
repository: OBDb/.schemas
path: tests/schemas
imageName: ghcr.io/obdb/devcontainer
push: never
env: |
GITHUB_SERVER_URL=${{ github.server_url }}
GITHUB_REPOSITORY=${{ github.repository }}
GITHUB_SHA=${{ github.sha }}
GITHUB_RUN_ID=${{ github.run_id }}
runCmd: |
pytest tests/ --ignore=tests/schemas -xvs -n auto > ./test-output.txt 2>&1
TEST_EXIT=$?
cat ./test-output.txt

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
cache: 'pip'
# Format results for PR comment with all required arguments
/usr/local/bin/format-test-results.sh \
test-output.txt \
$TEST_EXIT \
"$GITHUB_SERVER_URL" \
"$GITHUB_REPOSITORY" \
"$GITHUB_SHA" \
"$GITHUB_RUN_ID" \
> ./test-results.md || true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/schemas/requirements.txt
# Exit with the actual test result
exit $TEST_EXIT

- name: Run tests
id: run_tests
- name: Set test results output
if: always() && github.event_name == 'pull_request'
run: |
pytest tests/ --ignore=tests/schemas -xvs -n auto
continue-on-error: true
if [ -f test-results.md ]; then
{
echo 'TEST_RESULTS<<EOFMARKER'
cat test-results.md
echo 'EOFMARKER'
} >> $GITHUB_ENV
fi

- name: Print fix instructions
if: steps.run_tests.outcome == 'failure'
run: |
echo "::notice title=How to fix failed tests::To fix the failed tests, run: python3 tests/update_yaml_tests.py --verbose"
exit 1
- name: Comment test results on PR
if: always() && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
message: ${{ env.TEST_RESULTS }}
comment_tag: response-tests
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tests/schemas/
__pycache__
build/
.meta/
workspace/

.claude/skills
.claude/settings.local.json
tests/*.py
.vscode/*.json
11 changes: 0 additions & 11 deletions .vscode/settings.json

This file was deleted.

39 changes: 0 additions & 39 deletions .vscode/tasks.json

This file was deleted.

41 changes: 0 additions & 41 deletions tests/test_responses.py

This file was deleted.

93 changes: 0 additions & 93 deletions tests/update_yaml_tests.py

This file was deleted.

Loading