Skip to content

Commit 8574f4f

Browse files
authored
Update integration-testing.yml
1 parent 52b7728 commit 8574f4f

File tree

1 file changed

+26
-43
lines changed

1 file changed

+26
-43
lines changed

.github/workflows/integration-testing.yml

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,45 @@ jobs:
88
test-bigquery-magics:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout spanner-graph-notebook
11+
# Step 1: Checkout local PR of spanner-graph-notebook
12+
- name: Checkout spanner-graph-notebook (Repo A)
1213
uses: actions/checkout@v4
1314

1415
- name: Set up Python
1516
uses: actions/setup-python@v5
1617
with:
1718
python-version: '3.11'
1819

19-
- name: Install build dependencies
20-
run: python -m pip install build
21-
22-
- name: Build spanner-graph-notebook
23-
run: python -m build
24-
25-
- name: Checkout python-bigquery-magics
20+
# Step 2: Checkout python-bigquery-magics
21+
- name: Checkout python-bigquery-magics (Repo B)
2622
uses: actions/checkout@v4
2723
with:
2824
repository: googleapis/python-bigquery-magics
2925
path: python-bigquery-magics
3026

31-
- name: Diagnose Test Environment
27+
- name: Install and test
3228
run: |
3329
set -e
34-
echo "--- Preparing Environment ---"
3530
python -m venv venv
3631
. venv/bin/activate
37-
pip install pytest
38-
39-
echo "--- Installing Dependencies from Local Builds ---"
40-
# Using the two-step install process
41-
pip install dist/*.whl
42-
pip install ./python-bigquery-magics
43-
pip install google-cloud-testutils
44-
45-
# --- DIAGNOSTICS START ---
46-
echo "--- DIAGNOSTICS ---"
47-
48-
echo "[Step 1] Checking executable paths..."
49-
which python
50-
which pip
51-
52-
echo "\n[Step 2] Listing all installed packages..."
53-
pip freeze
54-
55-
echo "\n[Step 3] Checking content of site-packages..."
56-
ls -lR venv/lib/python3.11/site-packages/ | grep "spanner" || echo "spanner-graph-notebook not found in site-packages"
57-
58-
echo "\n[Step 4] Checking Python's import path..."
59-
python -c "import sys; from pprint import pprint; pprint(sys.path)"
60-
61-
echo "\n[Step 5] Attempting a direct import..."
62-
python -c "from spanner_graphs import graph_visualization" && echo "==> Direct import of graph_visualization SUCCEEDED" || echo "==> Direct import of graph_visualization FAILED"
63-
python -c "import spanner_graphs" && echo "==> Direct import of spanner_graphs SUCCEEDED" || echo "==> Direct import of spanner_graphs FAILED"
64-
65-
# --- DIAGNOSTICS END ---
66-
67-
echo "\n--- Running Tests ---"
68-
cd python-bigquery-magics
69-
pytest -v tests/unit/test_graph_server.py tests/unit/bigquery/test_bigquery.py
32+
33+
# Steps 3, 4, 5: Install test dependencies (pytest, etc.)
34+
# We also include portpicker, which was in your original file and is
35+
# likely required by the tests.
36+
pip install pytest google-cloud-testutils google-cloud-bigquery-storage portpicker
37+
38+
# Step 1 (continued): Install spanner-graph-notebook in editable mode
39+
# The '.' refers to the root directory, where Repo A was checked out.
40+
pip install -e .
41+
42+
# Step 2 (continued): Install python-bigquery-magics in editable mode
43+
# This installs from the 'python-bigquery-magics' subdirectory.
44+
# pip will see that spanner-graph-notebook is already installed.
45+
pip install -e ./python-bigquery-magics
46+
47+
# Prepend the required import to the test files
48+
echo "import spanner_graphs.graph_visualization as graph_visualization" | cat - python-bigquery-magics/tests/unit/test_graph_server.py > temp && mv temp python-bigquery-magics/tests/unit/test_graph_server.py
49+
echo "import spanner_graphs.graph_visualization as graph_visualization" | cat - python-bigquery-magics/tests/unit/bigquery/test_bigquery.py > temp && mv temp python-bigquery-magics/tests/unit/bigquery/test_bigquery.py
50+
51+
# Step 6: Run the tests
52+
pytest -v python-bigquery-magics/tests/unit/test_graph_server.py python-bigquery-magics/tests/unit/bigquery/test_bigquery.py

0 commit comments

Comments
 (0)