Skip to content

Commit ae3285b

Browse files
authored
Improve integration test output for debugging (#69)
* Remove integration test make targets from root makefile * Improve integration test deployment failure output * Improve readme instructions for local testing
1 parent 42b12c4 commit ae3285b

File tree

3 files changed

+11
-33
lines changed

3 files changed

+11
-33
lines changed

Makefile

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,6 @@ create-extension: ## [ext] Create extension folder
3939
# @[ -d dist ] && rm -r dist || true
4040
# uv build
4141

42-
# Python dependencies for Connect integration tests
43-
$(UV_LOCK): dev
44-
$(UV) lock
45-
46-
dev: ensure-uv ## [py] Install dependencies for Connect integration tests
47-
$(UV) pip install --upgrade -e .
48-
49-
$(VIRTUAL_ENV): ## [py] Create virtualenv for Connect integration tests
50-
$(UV) venv $(VIRTUAL_ENV)
51-
52-
ensure-uv: ## [py] Ensure UV and virtualenv are available for Connect integration tests
53-
@if ! command -v $(UV) >/dev/null; then \
54-
$(PYTHON) -m ensurepip && $(PYTHON) -m pip install "uv >= 0.4.27"; \
55-
fi
56-
@# Install virtual environment (before calling `uv pip install ...`)
57-
@$(MAKE) $(VIRTUAL_ENV) 1>/dev/null
58-
@# Be sure recent uv is installed
59-
@$(UV) pip install "uv >= 0.4.27" --quiet
60-
61-
docker-deps: ensure-uv ## [py] Install dependencies in Docker for Connect integration tests
62-
# Sync given the `uv.lock` file
63-
# --frozen : assert that the lock file exists
64-
# --no-install-project : do not install the project itself, but install its dependencies
65-
# $(UV) sync --frozen --no-install-project
66-
# Install dependencies from pyproject.toml directly
67-
$(UV) pip install .
68-
6942
help: FORCE ## Show help messages for make targets
7043
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; { \
7144
printf "\033[32m%-18s\033[0m", $$1; \

integration/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ It is primarily designed to be run in CI, but can also be run locally.
99
- Python
1010

1111
## Quick Start
12-
1. Use Makefile targets to set up and run tests
13-
2. For local testing:
14-
- Copy the packaged extension (*.tar.gz) to `integration/bundles`
15-
- Run: `make <connect-version> EXTENSION_NAME=<extension-name>`
12+
For local testing:
13+
- Install `uv` with a version matching that in `pyproject.toml`
14+
- Copy a valid Connect license file to `integration/license.lic`
15+
- Copy the packaged extension (*.tar.gz) to `integration/bundles`
16+
- Run: `make <connect-version> EXTENSION_NAME=<extension-name>`
1617
- `<connect-version>` matches a valid version from CONNECT_VERSIONS in the Makefile
1718
- `<extension-name>` matches the base name of your .tar.gz file (without the .tar.gz extension)
1819

integration/tests/posit/connect/test_deployments.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from urllib.parse import urlparse
55
from posit import connect
66
import requests
7+
import pprint
78

89
# Configuration constants - could be moved to environment variables
910
MAX_RETRIES = 6
@@ -55,9 +56,12 @@ def test_extension_deploys(self):
5556
deploy_time = time.time() - deploy_start
5657
print(f"Bundle deployment completed after {deploy_time:.1f}s")
5758

59+
# Format the task object so we can use it in our assertion messages for debugging
60+
task_pp = pprint.pformat(task, indent=2)
61+
5862
# Verify deployment succeeded
59-
assert task.is_finished is True, "Deployment task didn't finish"
60-
assert task.error_code == 0, f"Deployment failed with code {task.error_code}: {task.error_message}"
63+
assert task.is_finished is True, f"Deployment task didn't finish\nTask: {task_pp}"
64+
assert task.error_code == 0, f"Deployment failed with code {task.error_code}\nTask:{task_pp}"
6165

6266
# Refresh content after deployment
6367
self.content = self.client.content.get(self.content["guid"])

0 commit comments

Comments
 (0)