From ed0667cedc5d81310bc1abad5f09fee51a78b957 Mon Sep 17 00:00:00 2001 From: Travis Addair Date: Fri, 23 Feb 2024 09:48:28 -0800 Subject: [PATCH 1/3] Split out server and router unit tests --- .../{tests.yaml => router_tests.yaml} | 22 +---------- .github/workflows/server_tests.yaml | 38 +++++++++++++++++++ 2 files changed, 40 insertions(+), 20 deletions(-) rename .github/workflows/{tests.yaml => router_tests.yaml} (75%) create mode 100644 .github/workflows/server_tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/router_tests.yaml similarity index 75% rename from .github/workflows/tests.yaml rename to .github/workflows/router_tests.yaml index 412aad6e7..8b0549cd5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/router_tests.yaml @@ -1,10 +1,9 @@ -name: Server Tests +name: Router Tests on: pull_request: paths: - - ".github/workflows/tests.yaml" - - "server/**" + - ".github/workflows/router_tests.yaml" - "proto/**" - "router/**" - "launcher/**" @@ -27,10 +26,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: 3.9 - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -61,19 +56,6 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - - name: Filter test dependencies - run: | - # remove stanford-stk from test requirements as it cannot install correctly without GPUs - sed -i '/stanford-stk/d' server/requirements.txt - sed -i '/stanford-stk/d' server/pyproject.toml - - name: Install - run: | - make install - - name: Run server tests - run: | - pip install pytest - export HUGGING_FACE_HUB_TOKEN=${{ secrets.HUGGING_FACE_HUB_TOKEN }} - pytest -s -vv server/tests - name: Run Rust fmt run: | cargo fmt --check diff --git a/.github/workflows/server_tests.yaml b/.github/workflows/server_tests.yaml new file mode 100644 index 000000000..012c1d4d2 --- /dev/null +++ b/.github/workflows/server_tests.yaml @@ -0,0 +1,38 @@ +name: Server Tests + +on: + pull_request: + paths: + - ".github/workflows/server_tests.yaml" + - "server/**" + - "proto/**" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + run_tests: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.9 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + - name: Filter test dependencies + run: | + # remove stanford-stk from test requirements as it cannot install correctly without GPUs + sed -i '/stanford-stk/d' server/requirements.txt + sed -i '/stanford-stk/d' server/pyproject.toml + - name: Install + run: | + make install + - name: Run server tests + run: | + pip install pytest + export HUGGING_FACE_HUB_TOKEN=${{ secrets.HUGGING_FACE_HUB_TOKEN }} + pytest -s -vv server/tests From 934c338513d7457ada219f85ef2ddf611b3783d8 Mon Sep 17 00:00:00 2001 From: Travis Addair Date: Fri, 23 Feb 2024 10:04:07 -0800 Subject: [PATCH 2/3] Fix install --- .github/workflows/router_tests.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/router_tests.yaml b/.github/workflows/router_tests.yaml index 8b0549cd5..1fbad8c36 100644 --- a/.github/workflows/router_tests.yaml +++ b/.github/workflows/router_tests.yaml @@ -56,6 +56,9 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git + - name: Install + run: | + make install-router install-launcher - name: Run Rust fmt run: | cargo fmt --check From 097212429bc38ef3217cea4b2d94c2989ac4da95 Mon Sep 17 00:00:00 2001 From: Travis Addair Date: Fri, 23 Feb 2024 10:22:34 -0800 Subject: [PATCH 3/3] Skip router install --- .github/workflows/server_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/server_tests.yaml b/.github/workflows/server_tests.yaml index 012c1d4d2..b71ff6470 100644 --- a/.github/workflows/server_tests.yaml +++ b/.github/workflows/server_tests.yaml @@ -30,7 +30,7 @@ jobs: sed -i '/stanford-stk/d' server/pyproject.toml - name: Install run: | - make install + make install-server install-custom-kernels - name: Run server tests run: | pip install pytest