diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ae9a8cf..3124e4f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,8 +17,9 @@ 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: @@ -26,7 +27,8 @@ jobs: shell: bash -l {0} name: | - python=${{ matrix.python-version }} + os=${{ matrix.os }} + - python=${{ matrix.python-version }} steps: - name: Checkout the code @@ -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 diff --git a/tests/test_hub_integration.py b/tests/test_hub_integration.py new file mode 100644 index 00000000..831d266b --- /dev/null +++ b/tests/test_hub_integration.py @@ -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)