Skip to content

test: verify this configuration by publishing through it - #4

Open
rmdes wants to merge 1 commit into
getindiekit:mainfrom
rmdes:test/smoke-poc
Open

test: verify this configuration by publishing through it#4
rmdes wants to merge 1 commit into
getindiekit:mainfrom
rmdes:test/smoke-poc

Conversation

@rmdes

@rmdes rmdes commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Following on from #903, where @paulrobertlloyd suggested example-config as
a good place to give a proof of concept for testing this way.

What it does

Publishes a note through the Micropub API, checks the file the content
store received, and deletes it again — on push, and weekly.

The GitHub content store is pointed at a local stub via its baseUrl
option, so the test needs no access token, makes no network request and
writes to no repository, while still exercising the plug-ins, preset,
publication and syndicator options configured here.
test/indiekit.config.ci.js imports the published configuration and
overrides that one endpoint, so what is under test is the real config.

No secrets means it also runs on pull requests from forks.

Why

This repository depends on four ^1.0.0-beta packages. Its correctness is
a function of packages that change often, and nothing was watching.

Reintroducing the bug fixed in #3indiekit.config.js importing an
undeclared dotenv — the test fails with:

server exited (1):
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'dotenv'

The weekly run resolves the semver ranges rather than the lockfile, so a
change in a published package surfaces here rather than the next time
somebody clones this repository.

What it asserts

Publish returns 202 with a Location; the note is filed in the Jekyll
collection the preset defines; the stored file contains a marker unique to
the run; the write is one the GitHub API would accept (branch, commit
message, valid base64); q=config advertises the post types;
q=syndicate-to advertises the syndicator; deleting removes the file.

What it does not assert

That the advertised URL serves the post. There is no site generator here,
so that belongs with a starter that has one.

Notes

The test starts and stops its own server and refuses to run if the ports
are in use, so it cannot publish into a server it did not start. It also
names the missing-PASSWORD_SECRET case explicitly: without it Indiekit
redirects every route to first-run setup, and because redirects are
followed the failure otherwise looks like an unexplained 200.

Adds a smoke test that publishes a note through the Micropub API, checks the
file the content store received, and deletes it again. It runs on push and
weekly, so a change in a published `@indiekit/*` package fails here rather
than the next time somebody clones this repository.

The GitHub content store is pointed at a local stub through its `baseUrl`
option, so the test needs no access token, makes no network request and writes
to no repository, while still exercising the plug-ins, preset, publication and
syndicator options this repository ships. `test/indiekit.config.ci.js` imports
the published configuration and overrides that one endpoint, so the
configuration under test is the real one.

Asserted: the publish returns 202 with a Location header, the note is filed at
the Jekyll collection path the preset defines, the stored file contains a
marker unique to the run, `q=config` advertises the post types, `q=syndicate-to`
advertises the syndicator, and deleting the post removes the file.

Not asserted: that the reported URL serves the post. This repository has no
site generator, so that half belongs with a starter that does.

The test names the missing-PASSWORD_SECRET case explicitly. Without it Indiekit
redirects every route to first-run setup, and because redirects are followed
the failure otherwise surfaces as an unexplained 200.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant