Skip to content

Commit 367d6f3

Browse files
committed
Print runner IP.
1 parent ca6becb commit 367d6f3

File tree

5 files changed

+15
-16
lines changed

5 files changed

+15
-16
lines changed

sdks/python/apache_beam/ml/rag/enrichment/bigquery_vector_search_it_test.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@
3131
from apache_beam.testing.util import equal_to
3232

3333
# pylint: disable=ungrouped-imports
34-
try:
35-
from google.api_core.exceptions import BadRequest
36-
from apache_beam.transforms.enrichment import Enrichment
37-
from apache_beam.ml.rag.enrichment.bigquery_vector_search import \
38-
BigQueryVectorSearchEnrichmentHandler
39-
from apache_beam.ml.rag.enrichment.bigquery_vector_search import \
40-
BigQueryVectorSearchParameters
41-
except ImportError:
42-
raise unittest.SkipTest('BigQuery dependencies not installed')
34+
from google.api_core.exceptions import BadRequest
35+
from apache_beam.transforms.enrichment import Enrichment
36+
from apache_beam.ml.rag.enrichment.bigquery_vector_search import \
37+
BigQueryVectorSearchEnrichmentHandler
38+
from apache_beam.ml.rag.enrichment.bigquery_vector_search import \
39+
BigQueryVectorSearchParameters
4340

4441
_LOGGER = logging.getLogger(__name__)
4542

sdks/python/apache_beam/ml/rag/ingestion/alloydb_it_test.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
])
6969
registry.register_coder(MetadataConflictRow, RowCoder)
7070

71+
_LOGGER = logging.getLogger(__name__)
7172
VECTOR_SIZE = 768
7273

7374

@@ -146,12 +147,12 @@ class AlloyDBVectorWriterConfigTest(unittest.TestCase):
146147

147148
@classmethod
148149
def setUpClass(cls):
149-
cls.host = os.environ.get('ALLOYDB_HOST', '10.0.0.2')
150+
cls.host = os.environ.get('ALLOYDB_HOST', '10.119.0.22')
150151
cls.port = os.environ.get('ALLOYDB_PORT', '5432')
151152
cls.database = os.environ.get('ALLOYDB_DATABASE', 'postgres')
152153
cls.username = os.environ.get('ALLOYDB_USERNAME', 'postgres')
153154
if not os.environ.get('ALLOYDB_PASSWORD'):
154-
raise ValueError("ALLOYDB_PASSWORD is not set.")
155+
raise ValueError('ALLOYDB_PASSWORD env not set')
155156
cls.password = os.environ.get('ALLOYDB_PASSWORD')
156157

157158
# Create unique table name suffix
@@ -373,7 +374,7 @@ def custom_row_to_chunk(row):
373374
# Extract timestamp from custom_id
374375
timestamp = row.custom_id.split('timestamp_')[1]
375376
# Extract index from timestamp
376-
i = int(timestamp.split('T wrong')[1][:2])
377+
i = int(timestamp.split('T')[1][:2])
377378

378379
# Parse embedding vector
379380
embedding_list = [
@@ -488,7 +489,7 @@ def custom_row_to_chunk(row):
488489

489490
# Verify count
490491
count_result = rows | "Count All" >> beam.combiners.Count.Globally()
491-
assert_that(count_result, equal_to([num_records]), label='count_check')
492+
assert_that(count_result, equal_to([10]), label='count_check')
492493

493494
chunks = rows | "To Chunks" >> beam.Map(custom_row_to_chunk)
494495
assert_that(chunks, equal_to(test_chunks), label='chunks_check')

sdks/python/scripts/run_integration_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ PIPELINE_OPTS=${PIPELINE_OPTS//\"/\\\"}
270270
echo ">>> RUNNING integration tests with pipeline options: $PIPELINE_OPTS"
271271
echo ">>> pytest options: $TEST_OPTS"
272272
echo ">>> collect markers: $COLLECT_MARKERS"
273-
ARGS="-o junit_suite_name=$SUITE -o log_cli=true -o log_level=INFO --junitxml=pytest_$SUITE.xml $TEST_OPTS"
273+
ARGS="-v -rs -o junit_suite_name=$SUITE -o log_cli=true -o log_level=INFO --junitxml=pytest_$SUITE.xml $TEST_OPTS"
274274
# Handle markers as an independent argument from $TEST_OPTS to prevent errors in space separated flags
275275
if [ -z "$COLLECT_MARKERS" ]; then
276276
pytest $ARGS --test-pipeline-options="$PIPELINE_OPTS"

sdks/python/scripts/run_pytest.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ echo "pytest_args: $pytest_args"
4141
echo "posargs: $posargs"
4242

4343
# Run with pytest-xdist and without.
44-
pytest -o junit_suite_name=${envname} \
44+
pytest -v -rs -o junit_suite_name=${envname} \
4545
--junitxml=pytest_${envname}.xml -m 'not no_xdist' -n 6 --import-mode=importlib ${pytest_args} --pyargs ${posargs}
4646
status1=$?
47-
pytest -o junit_suite_name=${envname}_no_xdist \
47+
pytest -v -rs -o junit_suite_name=${envname}_no_xdist \
4848
--junitxml=pytest_${envname}_no_xdist.xml -m 'no_xdist' --import-mode=importlib ${pytest_args} --pyargs ${posargs}
4949
status2=$?
5050

sdks/python/tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ commands =
117117
# many packages do not support py3.12
118118
# Don't set TMPDIR to avoid "AF_UNIX path too long" errors in certain tests.
119119
setenv =
120+
passenv = ALLOYDB_PASSWORD
120121
extras = test,gcp,dataframe,p312_ml_test
121122
commands =
122123
# Log tensorflow version for debugging

0 commit comments

Comments
 (0)