Skip to content

Commit f113c50

Browse files
authored
Update README and makefile to improve local testing experience (#89)
1 parent 0e0aba6 commit f113c50

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

integration/Makefile

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ PYTEST_ARGS ?= "-s"
5252
up-%
5353

5454

55-
# All versions starting with 2025.03.0 (first Connect version fully supporting extensions, version matching) and newer
55+
# All versions starting with the first Connect version that fully supports extensions and version matching
5656
# Note connect-preview is the same version in the `preview` target. It is included here as part of the full list of all
5757
# possible versions to test against in CI or when using the `all` target.
5858
CONNECT_VERSIONS := \
5959
connect-preview \
60-
2025.03.0
60+
2025.04.0
6161

6262

6363
# Compute the latest official release version (excludes connect-preview)
@@ -245,6 +245,26 @@ print-versions:
245245
@printf "%s\n" $(strip $(CONNECT_VERSIONS))
246246

247247

248+
# Package an extension into a tar.gz file. This only works for simple extensions.
249+
# Usage: make package-extension EXTENSION_NAME=<extension-name>
250+
package-extension:
251+
@if [ -z "$(EXTENSION_NAME)" ]; then \
252+
echo "Error: EXTENSION_NAME is required."; \
253+
echo "Usage: make package-extension EXTENSION_NAME=<extension-name>"; \
254+
exit 1; \
255+
fi
256+
@if [ ! -d "../extensions/$(EXTENSION_NAME)" ]; then \
257+
echo "Error: Extension directory 'extensions/$(EXTENSION_NAME)' does not exist."; \
258+
echo "Available extensions:"; \
259+
ls -1 ../extensions/; \
260+
exit 1; \
261+
fi
262+
@mkdir -p ./integration/bundles
263+
@echo "Packaging extension: $(EXTENSION_NAME)"
264+
@tar -czf ./bundles/$(EXTENSION_NAME).tar.gz ../extensions/$(EXTENSION_NAME)
265+
@echo "✅ Package created: ./bundles/$(EXTENSION_NAME).tar.gz"
266+
267+
248268
# Show help message.
249269
help:
250270
@echo "Makefile Targets:"
@@ -257,6 +277,7 @@ help:
257277
@echo " down Tear down Docker resources for all Connect versions."
258278
@echo " clean Clean up the project directory."
259279
@echo " print-versions Show the available Connect versions."
280+
@echo " package-extension Package an extension into a tar.gz file."
260281
@echo " help Show this help message."
261282
@echo
262283
@echo "Required Parameters:"

integration/README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ This directory contains integration tests for Connect Extensions.
55
It is primarily designed to be run in CI, but can also be run locally.
66

77
## Prerequisites
8-
- [UV package manager](https://docs.astral.sh/uv/getting-started/installation/)
9-
- Python
8+
9+
- [UV package manager](https://docs.astral.sh/uv/getting-started/installation/) with the same version from `[tool.uv]` in `integrations/pyproject.toml`
10+
- Python with the same version in `integrations/pyproject.toml`
1011

1112
## Quick Start
13+
1214
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>`
17-
- `<connect-version>` matches a valid version from CONNECT_VERSIONS in the Makefile
18-
- `<extension-name>` matches the base name of your .tar.gz file (without the .tar.gz extension)
15+
- All instructions are run from the root directory
16+
- Copy a valid Connect license file to `integration/license.lic` making sure the license enables all of the features your content requires, for example API Publishing
17+
- Copy the packaged extension (\*.tar.gz) to `integration/bundles` or create one using `make -C ./integration package-extension EXTENSION_NAME=my-extension`
18+
- Run integration tests against a specific Connect version: `make -C ./integration <connect-version> EXTENSION_NAME=<extension-name>`
19+
- `<connect-version>` matches a valid version from CONNECT_VERSIONS in the Makefile
20+
- `<extension-name>` matches the base name of your .tar.gz file (without the .tar.gz extension)
1921

2022
Example:
21-
- `make 2025.03.0 EXTENSION_NAME=publisher-command-center`
2223

23-
For detailed commands and examples, run: `make help`
24+
- `make -C ./integration 2025.04.0 EXTENSION_NAME=my-extension`
25+
26+
For detailed commands and examples, run: `make -C ./integration help`

0 commit comments

Comments
 (0)