Skip to content

Commit

Permalink
Added test cases for Windows and add integration test with Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
cwognum committed Dec 3, 2024
1 parent 75bea60 commit b4f9584
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

runs-on: "ubuntu-latest"
runs-on: ${{ matrix.os }}
timeout-minutes: 30

defaults:
run:
shell: bash -l {0}

name: |
python=${{ matrix.python-version }}
os=${{ matrix.os }}
- python=${{ matrix.python-version }}
steps:
- name: Checkout the code
Expand All @@ -47,6 +49,9 @@ jobs:

- name: Run tests
run: pytest
env:
POLARIS_USERNAME: ${{ secrets.POLARIS_USERNAME }}
POLARIS_PASSWORD: ${{ secrets.POLARIS_PASSWORD }}

- name: Test CLI
run: polaris --help
Expand Down
25 changes: 25 additions & 0 deletions tests/test_hub_integration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os

import pytest

import polaris as po
from polaris.benchmark._base import BenchmarkSpecification
from polaris.dataset._base import BaseDataset


@pytest.mark.skipif(
os.getenv("POLARIS_PASSWORD") is None and os.getenv("POLARIS_USER") is None,
reason="This test case requires headless authentication to be set up",
)
def test_load_dataset_flow():
dataset = po.load_dataset("polaris/hello-world")
assert isinstance(dataset, BaseDataset)


@pytest.mark.skipif(
os.getenv("POLARIS_PASSWORD") is None and os.getenv("POLARIS_USER") is None,
reason="This test case requires headless authentication to be set up",
)
def test_load_benchmark_flow():
benchmark = po.load_benchmark("polaris/hello-world-benchmark")
assert isinstance(benchmark, BenchmarkSpecification)

0 comments on commit b4f9584

Please sign in to comment.