Test torch_geometric.llm in CI
#1780
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Testing RAG | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - 'torch_geometric/datasets/web_qsp_dataset.py' | |
| - 'torch_geometric/llm/**' | |
| pull_request: | |
| paths: | |
| - 'torch_geometric/datasets/web_qsp_dataset.py' | |
| - 'torch_geometric/llm/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ startsWith(github.ref, 'refs/pull/') || github.run_number }} # yamllint disable-line | |
| # Only cancel intermediate builds if on a PR: | |
| cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
| jobs: | |
| rag_pytest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup packages | |
| uses: ./.github/actions/setup | |
| with: | |
| full_install: false | |
| - name: Install main package | |
| run: | | |
| uv pip install -e ".[test,rag]" | |
| - name: Run tests | |
| timeout-minutes: 10 | |
| run: | | |
| set +e # Don't exit on first failure | |
| ulimit -c 0 | |
| export TOKENIZERS_PARALLELISM=false | |
| export RAG_TEST=1 | |
| export PYTORCH_TEST_WITH_SLOW=1 | |
| # Collect test names into a file | |
| uv run --no-project pytest -m rag --collect-only -q > test_list.txt 2>&1 | |
| # Filter for test node IDs and run them | |
| grep "::" test_list.txt | while IFS= read -r test; do | |
| echo "=========================================" | |
| echo "Running: $test" | |
| echo "=========================================" | |
| uv run --no-project pytest -m rag "$test" -v | |
| exit_code=$? | |
| if [ $exit_code -eq 0 ]; then | |
| echo "✓ PASSED: $test" | |
| else | |
| echo "✗ FAILED with exit code $exit_code: $test" | |
| fi | |
| echo "" | |
| done | |
| echo "All tests completed" | |
| shell: bash |