Unverified Commit 996077f4 authored by Pavithra Vijayakrishnan's avatar Pavithra Vijayakrishnan Committed by GitHub
Browse files

ci: Run the same tests across Github and Gitlab CI for premerge (#5082)


Signed-off-by: default avatarpvijayakrish <pvijayakrish@nvidia.com>
parent 975870d5
...@@ -32,6 +32,10 @@ inputs: ...@@ -32,6 +32,10 @@ inputs:
description: 'Start MinIO service for LoRA tests (true/false)' description: 'Start MinIO service for LoRA tests (true/false)'
required: false required: false
default: 'true' default: 'true'
enable_mypy:
description: 'Enable mypy type checking during test run (true/false)'
required: false
default: 'false'
runs: runs:
...@@ -110,7 +114,12 @@ runs: ...@@ -110,7 +114,12 @@ runs:
PYTEST_CMD="pytest -v --collect-only -m \"${{ inputs.pytest_marks }}\"" PYTEST_CMD="pytest -v --collect-only -m \"${{ inputs.pytest_marks }}\""
else else
echo "🚀 Running pytest in normal mode" echo "🚀 Running pytest in normal mode"
PYTEST_CMD="pytest -v --tb=short --basetemp=/tmp -o cache_dir=/tmp/.pytest_cache --junitxml=/workspace/test-results/${{ env.PYTEST_XML_FILE }} --durations=10 -m \"${{ inputs.pytest_marks }}\"" MYPY_FLAG=""
if [[ "${{ inputs.enable_mypy }}" == "true" ]]; then
echo "🔍 Mypy type checking enabled"
MYPY_FLAG="--mypy"
fi
PYTEST_CMD="pytest -v --tb=short --basetemp=/tmp -o cache_dir=/tmp/.pytest_cache --junitxml=/workspace/test-results/${{ env.PYTEST_XML_FILE }} --durations=10 ${MYPY_FLAG} -m \"${{ inputs.pytest_marks }}\""
# Detect GPU availability and conditionally add GPU flags # Detect GPU availability and conditionally add GPU flags
GPU_FLAGS="" GPU_FLAGS=""
......
...@@ -198,6 +198,7 @@ jobs: ...@@ -198,6 +198,7 @@ jobs:
framework: "vllm" framework: "vllm"
test_type: "pre_merge" test_type: "pre_merge"
platform_arch: ${{ matrix.platform.arch }} platform_arch: ${{ matrix.platform.arch }}
enable_mypy: 'true'
sglang: sglang:
needs: changed-files needs: changed-files
...@@ -259,6 +260,7 @@ jobs: ...@@ -259,6 +260,7 @@ jobs:
framework: "sglang" framework: "sglang"
test_type: "pre_merge" test_type: "pre_merge"
platform_arch: ${{ matrix.platform.arch }} platform_arch: ${{ matrix.platform.arch }}
enable_mypy: 'true'
trtllm: trtllm:
needs: changed-files needs: changed-files
...@@ -320,6 +322,7 @@ jobs: ...@@ -320,6 +322,7 @@ jobs:
framework: "trtllm" framework: "trtllm"
test_type: "pre_merge" test_type: "pre_merge"
platform_arch: ${{ matrix.platform.arch }} platform_arch: ${{ matrix.platform.arch }}
enable_mypy: 'true'
deploy-operator: deploy-operator:
runs-on: cpu-amd-m5-2xlarge runs-on: cpu-amd-m5-2xlarge
......
...@@ -97,19 +97,19 @@ jobs: ...@@ -97,19 +97,19 @@ jobs:
docker run -w /workspace \ docker run -w /workspace \
--name ${{ env.CONTAINER_ID }}_pytest_parallel \ --name ${{ env.CONTAINER_ID }}_pytest_parallel \
${{ steps.define_image_tag.outputs.image_tag }} \ ${{ steps.define_image_tag.outputs.image_tag }} \
bash -c "pytest --basetemp=/tmp/pytest-parallel --junitxml=${{ env.PYTEST_PARALLEL_XML_FILE }} -n 4 -m \"${{ env.PYTEST_MARKS }}\"" bash -c "pytest --mypy --basetemp=/tmp/pytest-parallel --junitxml=${{ env.PYTEST_PARALLEL_XML_FILE }} -n 4 -m \"${{ env.PYTEST_MARKS }}\""
- name: Copy parallel test report from Container - name: Copy parallel test report from Container
if: always() if: always()
run: | run: |
docker cp ${{ env.CONTAINER_ID }}_pytest_parallel:/workspace/${{ env.PYTEST_PARALLEL_XML_FILE }} . || echo "No parallel test report found" docker cp ${{ env.CONTAINER_ID }}_pytest_parallel:/workspace/${{ env.PYTEST_PARALLEL_XML_FILE }} . || echo "No parallel test report found"
- name: Run pytest (sequential tests) - name: Run pytest (sequential tests)
env: env:
PYTEST_MARKS: "((pre_merge and not parallel) or mypy) and not (vllm or sglang or trtllm) and (gpu_0 or gpu_1)" PYTEST_MARKS: "pre_merge and not parallel and not (vllm or sglang or trtllm) and (gpu_0 or gpu_1)"
run: | run: |
docker run -w /workspace \ docker run -w /workspace \
--name ${{ env.CONTAINER_ID }}_pytest \ --name ${{ env.CONTAINER_ID }}_pytest \
${{ steps.define_image_tag.outputs.image_tag }} \ ${{ steps.define_image_tag.outputs.image_tag }} \
bash -c "pytest --basetemp=/tmp --junitxml=${{ env.PYTEST_XML_FILE }} -m \"${{ env.PYTEST_MARKS }}\" " bash -c "pytest --mypy --basetemp=/tmp --junitxml=${{ env.PYTEST_XML_FILE }} -m \"${{ env.PYTEST_MARKS }}\" "
- name: Copy test report from test Container - name: Copy test report from test Container
if: always() if: always()
run: | run: |
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment