@medialit/integration-tests 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +37 -2
  2. package/dist/bin.mjs +1656 -0
  3. package/package.json +43 -5
package/README.md CHANGED
@@ -1,3 +1,38 @@
1
- # Temporary Holding Version
1
+ # @medialit/integration-tests
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ End-to-end tests and a synthetic check for a [MediaLit](https://medialit.cloud) server, hosted or self-hosted.
4
+
5
+ ## Synthetic check
6
+
7
+ A quick check that MediaLit works end to end. It checks `/ready`, then uploads a tiny public image, seals it, downloads it and deletes it, in about a second. It is safe to run against production every few minutes.
8
+
9
+ ```bash
10
+ MEDIALIT_APIKEY=... MEDIALIT_SERVER=https://medialit.example.com \
11
+ npx @medialit/integration-tests@0.1.0 synthetic
12
+ ```
13
+
14
+ - Use the API key of an app that exists only for monitoring. The synthetic check never changes settings and only deletes files in its own `__synthetic_` groups, including leftovers from runs that were cut short.
15
+ - Set `MEDIALIT_SYNTHETIC_HEARTBEAT_URL` to a heartbeat monitor such as Better Stack or Healthchecks.io. The synthetic check requests the URL after each passing run and `<url>/fail` after a failing one, so you are alerted when MediaLit fails and when the synthetic check stops running.
16
+ - It exits with 1 when a step fails, and names the step and the reason.
17
+ - Pin the version. The monitoring key is in the synthetic check's environment, so don't run whatever version is newest.
18
+
19
+ ## Test suites
20
+
21
+ The suites cover the REST API, the MCP server and the CLI in depth. They upload files, change media settings and restore them, so run them against a test app with no other activity.
22
+
23
+ ```bash
24
+ MEDIALIT_APIKEY=... MEDIALIT_SERVER=localhost:8000 \
25
+ npx @medialit/integration-tests@0.1.0 all
26
+ ```
27
+
28
+ | Command | Runs |
29
+ | ----------- | -------------------------------------------------------------------- |
30
+ | `synthetic` | The synthetic check |
31
+ | `all` | The REST, MCP and CLI suites |
32
+ | `rest` | The REST API suite |
33
+ | `mcp` | The MCP server suite |
34
+ | `cli` | The CLI suite. Set `MEDIALIT_CLI` to the `medialit` command to test. |
35
+
36
+ In the MediaLit repository, run them with `bun run test:integration`, or `bun --filter @medialit/integration-tests <script>` with `synthetic`, `test:rest`, `test:mcp` or `test:cli`.
37
+
38
+ To run all three suites against a fresh local stack (Postgres, MinIO and Mailpit from `docker-compose.local.yml`, plus the API), the same way the pull request check does, run `bun run test:integration:stack` from the repository root. It needs Docker, uses its own ports, and leaves your dev stack and `apps/api/.env` alone.