Skip to content

Commit a27bec3

Browse files
authored
Build: Decouple setup and exec in integration tests for better flexibility (#1985)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change Decouple setup and exec in integration tests for better flexibility and isolation. For example, currently, `make test-integration` must be executed in a physical server. It is because `docker xxx` cannot be executed within a container (docker in docker is out of scope of this PR). Sometimes, it is useful for local debugging, as poetry cannot provide system level isolation, includes environment variables and shared libs. This PR allows us to run `make test-integration-exec` within a container environment, after we have run `make test-integration-setup` on this server. # Are these changes tested? Existing tests. # Are there any user-facing changes? No.
1 parent 45e2e91 commit a27bec3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,17 @@ test-s3: # Run tests marked with s3, can add arguments with PYTEST_ARGS="-vv"
5252
sh ./dev/run-minio.sh
5353
poetry run pytest tests/ -m s3 ${PYTEST_ARGS}
5454

55-
test-integration: ## Run all integration tests, can add arguments with PYTEST_ARGS="-vv"
55+
test-integration: | test-integration-setup test-integration-exec ## Run all integration tests, can add arguments with PYTEST_ARGS="-vv"
56+
57+
test-integration-setup: # Prepare the environment for integration
5658
docker compose -f dev/docker-compose-integration.yml kill
5759
docker compose -f dev/docker-compose-integration.yml rm -f
5860
docker compose -f dev/docker-compose-integration.yml up -d
5961
sleep 10
6062
docker compose -f dev/docker-compose-integration.yml cp ./dev/provision.py spark-iceberg:/opt/spark/provision.py
6163
docker compose -f dev/docker-compose-integration.yml exec -T spark-iceberg ipython ./provision.py
64+
65+
test-integration-exec: # Execute integration tests, can add arguments with PYTEST_ARGS="-vv"
6266
poetry run pytest tests/ -v -m integration ${PYTEST_ARGS}
6367

6468
test-integration-rebuild:

0 commit comments

Comments
 (0)