From 9323505aed52378efee9be968045423acdc47432 Mon Sep 17 00:00:00 2001 From: Anjali Ratnam Date: Fri, 9 May 2025 11:16:46 -0700 Subject: [PATCH 1/2] e2e workflow --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++ tests/e2e/test_torch_serialize.py | 4 ++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcdca99..ea80805 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,3 +72,42 @@ jobs: run: ruff check . - name: Run ruff format run: ruff format --check + run-e2e-tests: + name: Run E2E tests + needs: build-dists + permissions: + id-token: write + contents: read + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] + os: [ ubuntu-latest, macOS-latest, windows-latest ] + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' }} + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - name: Download distributions + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 + with: + name: dists + path: dist/ + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install -r requirements-dev.txt + python -m pip install --find-links=dist azstoragetorch + python -m pip install pytest torchvision + - name: Azure login + uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a + with: + client-id: ${{ secrets.AZURE_E2E_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_E2E_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_E2E_SUBSCRIPTION_ID }} + - name: Run tests + run: pytest tests/e2e + env: + AZSTORAGETORCH_STORAGE_ACCOUNT_NAME: ${{ secrets.AZURE_E2E_STORAGE_ACCOUNT_NAME }} diff --git a/tests/e2e/test_torch_serialize.py b/tests/e2e/test_torch_serialize.py index fa3e7b6..7a25bbf 100644 --- a/tests/e2e/test_torch_serialize.py +++ b/tests/e2e/test_torch_serialize.py @@ -5,6 +5,7 @@ # -------------------------------------------------------------------------- import pytest import torch +import torchvision.models from azstoragetorch.io import BlobIO from utils import random_resource_name @@ -20,8 +21,7 @@ def torch_hub_cache(tmp_path_factory): @pytest.fixture(scope="module") def model(): - model = torch.hub.load("pytorch/vision:v0.10.0", "resnet101", pretrained=False) - return model + return torchvision.models.resnet101() @pytest.fixture(scope="module") From 4865e1972aa949475eb919308d30bcfebf20500e Mon Sep 17 00:00:00 2001 From: Anjali Ratnam Date: Wed, 28 May 2025 09:45:25 -0700 Subject: [PATCH 2/2] updates --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea80805..35944d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,6 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install -r requirements-dev.txt python -m pip install --find-links=dist azstoragetorch python -m pip install pytest torchvision - name: Azure login