Replace shell smoke test with Go integration tests#26
Conversation
| } | ||
| } | ||
|
|
||
| func runComposer(t *testing.T, composerPath, dir string, args ...string) string { |
There was a problem hiding this comment.
How about using https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript ?
We can test it against multiple composer versions via docker images.
Also open up the possibility to run e2e test against production server.
Examples:
There was a problem hiding this comment.
Using docker for multiple versions is definitely better 👍 think I'll defer as a follow-up though
There was a problem hiding this comment.
Seems like testscript would be better for testing your own binaries? like trellis-cli testing itself whereas this is running composer.
There was a problem hiding this comment.
My idea is e2e of is:
- one end is composer
- the other end is wp-composer.com (the test subject)
During the test:
- Seed the database + prepare some
/p2/files - Boot
wp-composer serve testscriptstoexec composer installsomething from step 2
Composer is not the test subject. Goal is to assert the server in step 2 (ie: the local wp-composer.com) can be used by composer.
0b0090b to
98c0588
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98c0588250
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
98c0588 to
cc09d27
Compare
Replaces the 480-line bash smoke test with Go integration tests that are deterministic, fast, and self-contained. The new test infrastructure uses fixture data and a mock wp.org server so tests run without network dependencies on the WordPress.org API. New files: - Mock wp.org server (internal/wporg/mock_server.go) + API fixtures - Test DB helpers (internal/testutil/testdb.go) for in-memory SQLite - Integration smoke test covering full pipeline, HTTP endpoints, composer install, version pinning, and build integrity - R2 sync test using gofakes3 for S3-compat verification - Live canary test for nightly runs against real wp.org - Fixture capture script (test/capture-fixtures.sh) - Canary CI workflow (.github/workflows/canary.yml) Changes: - wporg.Client now supports configurable base URL via SetBaseURL() - S3 client uses path-style addressing (needed for R2 + test compat) - CI workflow gains integration test job (stub CSS, no Tailwind needed) - Makefile: smoke target replaced with integration target Deleted: test/smoke_test.sh, .github/workflows/smoke-test.yml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The httptest server uses plain HTTP (http://127.0.0.1:...) which Composer's secure-http default blocks. Add secure-http: false to the generated composer.json config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cc09d27 to
346b87c
Compare
Replaces the 480-line bash smoke test with Go integration tests that are deterministic, fast, and self-contained. The new test infrastructure uses fixture data and a mock wp.org server so tests run without network dependencies on the WordPress.org API.
New files:
Changes:
Deleted: test/smoke_test.sh, .github/workflows/smoke-test.yml