@anvil-works/anvil-cli 0.8.0-canary.24 → 0.8.0-canary.25
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.
- package/README.md +20 -0
- package/dist/appRoot.d.ts +11 -0
- package/dist/appRoot.d.ts.map +1 -0
- package/dist/cli.js +569 -87
- package/dist/commands/db.d.ts.map +1 -1
- package/dist/commands/deps.d.ts.map +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/secret.d.ts.map +1 -1
- package/dist/commands/test.d.ts +15 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/index.js +24 -24
- package/dist/program.d.ts.map +1 -1
- package/dist/services/anvil-api.d.ts +9 -0
- package/dist/services/anvil-api.d.ts.map +1 -1
- package/dist/services/db.d.ts.map +1 -1
- package/dist/services/server-tests.d.ts +47 -0
- package/dist/services/server-tests.d.ts.map +1 -0
- package/dist/validators.d.ts +0 -1
- package/dist/validators.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -262,6 +262,25 @@ Use `--json` with `anvil convert-template` to emit the source path, output path,
|
|
|
262
262
|
|
|
263
263
|
Conversion uses `@anvil-works/form-template-parser`. When package-qualified form specs such as `form:MyForm` or dependency `item_template` values are present, the command reads `anvil.yaml` (and `.anvil/deps/manifest.json` when needed) to canonicalize them before serializing HTML.
|
|
264
264
|
|
|
265
|
+
### `anvil test`
|
|
266
|
+
|
|
267
|
+
Run your app's server tests (`tests/server_tests`) on Anvil, and print pytest's output as they run.
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
anvil test
|
|
271
|
+
anvil test tests/server_tests/test_orders.py::test_refund
|
|
272
|
+
anvil test -k "login and not slow"
|
|
273
|
+
anvil test --collect-only
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
The tests run on the commit you have checked out (`HEAD`), which must already be pushed to Anvil. If you have uncommitted changes, the command warns you that they aren't included.
|
|
277
|
+
|
|
278
|
+
Targets are paths or pytest node IDs in `tests/server_tests`, relative to the current directory. `-k` takes a pytest keyword expression.
|
|
279
|
+
|
|
280
|
+
The app, server and account are chosen as `anvil watch` chooses them, including asking you when there's a choice. In CI, use `-A, --appid <APP_ID>`, `-u, --url <ANVIL_URL>` and `-U, --user <USERNAME>` when the choice is ambiguous. `--json` disables prompts.
|
|
281
|
+
|
|
282
|
+
The command exits with pytest's exit code, for example `0` if every test passed and `1` if any failed, so you can use it in CI. If the run couldn't start or finish, for example because the server runtime failed to launch, it prints the error and exits `1`. Press Ctrl-C to cancel the run.
|
|
283
|
+
|
|
265
284
|
### Other useful commands
|
|
266
285
|
|
|
267
286
|
```bash
|
|
@@ -274,6 +293,7 @@ anvil config set <key> <value>
|
|
|
274
293
|
anvil config reset
|
|
275
294
|
anvil validate <file>
|
|
276
295
|
anvil convert-template <file>
|
|
296
|
+
anvil test
|
|
277
297
|
anvil version
|
|
278
298
|
anvil update
|
|
279
299
|
anvil --help
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the root directory of the Anvil app (the directory holding its anvil.yaml) that
|
|
3
|
+
* contains `filePath`, or null if `filePath` doesn't exist or isn't inside an app.
|
|
4
|
+
*/
|
|
5
|
+
export declare function findAnvilAppRoot(filePath: string): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* The root of the Anvil app containing `startPath`, so that app commands work from any of its subdirectories.
|
|
8
|
+
* Throws if `startPath` isn't inside an app.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveAppRoot(startPath?: string): string;
|
|
11
|
+
//# sourceMappingURL=appRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appRoot.d.ts","sourceRoot":"","sources":["../src/appRoot.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuChE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,GAAE,MAAsB,GAAG,MAAM,CAQxE"}
|