These tests call a live YTsaurus cell through YTProdClient and yt.wrapper. They live under tests/integration/yt_cluster/ and use the pytest marker yt_cluster.
The same collection skip rules apply to tests/integration/examples_cluster/ (subprocess checks for prod-oriented demos). Both packages are skipped when CI=true or when YT_PROXY/YT_TOKEN are not available from the usual cluster test env files.
pytest loads those directories only if both YT_PROXY and YT_TOKEN are set after this lookup:
YT_FRAMEWORK_CLUSTER_TEST_ENV— path to aKEY=valuefile (same format asconfigs/secrets.env).- Otherwise, if
yt-cluster-test.envexists at the repository root, that file is read. - Values from the process environment override the file for the keys listed in the example file.
If the pair is missing, those packages are skipped at collection time. On CI hosts, CI=true also forces that skip. GitHub Actions additionally runs pytest -m "not yt_cluster", so real-cluster tests never run in CI even if credentials were present by mistake.
Copy the template and fill in real values (the real file is gitignored):
cp yt-cluster-test.example.env yt-cluster-test.envNever commit yt-cluster-test.env. You can instead export YT_PROXY and YT_TOKEN in the shell or in CI secrets.
From the repo root, using the project Conda env:
conda run -n yt-framework -- pytest -m yt_cluster -xvsNarrower:
conda run -n yt-framework -- pytest tests/integration/yt_cluster/test_yql.py -xvs(example-pipelines-cluster)=
Optional subprocess tests under tests/integration/examples_cluster/ exercise the prod-mode demos 06_s3_integration and 07_custom_docker. They reuse the same yt-cluster-test.env (or YT_FRAMEWORK_CLUSTER_TEST_ENV) as the library’s cluster tests: credentials are merged into a temp copy of the example so we never require committing secrets.env inside examples/.
S3 listing (06_s3_integration)
- Set
YT_FRAMEWORK_EXAMPLE_S3=1. - Put
S3_ENDPOINT,S3_DOWNLOAD_ACCESS_KEY, andS3_DOWNLOAD_SECRET_KEYinyt-cluster-test.envand/orexamples/06_s3_integration/configs/secrets.env. - Fill
client.input_bucketandclient.input_prefixinexamples/06_s3_integration/stages/list_s3/config.yamlfor a bucket you may read.
Custom Docker (07_custom_docker)
- Set
YT_FRAMEWORK_EXAMPLE_DOCKER=1. - Ensure the image referenced in that example’s stage config is pullable on your cell.
Run only those tests:
conda run -n yt-framework -- pytest tests/integration/examples_cluster/ -m yt_cluster -xvsDetails on env files: Example pipelines.
- Cypress namespace:
//tmp/yt-framework/testing/<session_id>/…for tables and files. The session fixture creates that node and deletes it recursively after the run. - Host scratch:
/tmp/yt-framework/testing/<session_id>/…for local files used inupload_file/upload_directory. It is removed when the session ends. - Docker: map, map-reduce, reduce, and vanilla jobs do not pass
docker_imageinOperationResources, so the cell’s default job image is used. The scripts callpython3and trivial shell (true). Secure-env command wrapping also relies onpython3andbash. If a job fails with “command not found”, your default image may differ; adjust the command in the test to match the image, not the framework. - YQL helpers on the client call
run_yqlwith pool namedefaultinside the library. Map/sort operations useYT_TEST_POOL(defaultdefault) when the test passesop_resources.pool. - Optional knobs in the env file:
YT_TEST_POOL,YT_TEST_POOL_TREE,YT_TEST_MEMORY_GB,YT_TEST_CPU_LIMIT,YT_TEST_JOB_COUNT. - Map extras (
test_map_operations.py): mapperenvpropagation, a secondrun_mapwithappend=True, thejob=alias (nocommand), two Cypress file dependencies, forwarded options such astitle,max_row_weight, andmax_failed_jobs, and a check that sensitive env keys are not present in the operation’s plainmapper.environmentwhile jobs still read them at runtime (viasecure_vault+ promotion).