Adds the `pic groups` command family over /api/v1/admin/groups: ls/tree, create (--parent), show (path + subgroups + apps), rename (name/description; slug frozen), reparent (--to), rm (--recursive, leaf-first; never auto-deletes apps), and members add/set/rm/ls. Also `pic apps create --group <slug>` to place an app under a group. End-to-end journey tests (tests/groups.rs, DB-gated) cover tree CRUD, delete=RESTRICT (409 on a non-empty group), reparent cycle rejection, and the headline invariant: a group_admin on an ancestor group can deploy to an app it is NOT a direct member of (inherited membership), and loses that access immediately on revoke — all green against a live server. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
40 lines
853 B
Rust
40 lines
853 B
Rust
//! Integration-test binary for the `pic` CLI.
|
|
//!
|
|
//! Every `#[test]` in this binary routes through `common::fixture()`, a
|
|
//! `LazyLock` that spawns picloud once on a private port and reuses it
|
|
//! across all journey modules. Mirrors the dashboard Playwright suite,
|
|
//! which spins backend + Vite up once for 63 specs.
|
|
//!
|
|
//! Gated on `DATABASE_URL`. To run:
|
|
//!
|
|
//! docker compose up -d postgres
|
|
//! DATABASE_URL=postgres://picloud:picloud@127.0.0.1:15432/picloud \
|
|
//! cargo test -p picloud-cli --test cli -- --include-ignored
|
|
|
|
mod common;
|
|
|
|
mod admins;
|
|
mod api_keys;
|
|
mod apply;
|
|
mod apps;
|
|
mod auth;
|
|
mod config;
|
|
mod dead_letters;
|
|
mod email_queue;
|
|
mod enabled;
|
|
mod env_overlay;
|
|
mod groups;
|
|
mod init;
|
|
mod invoke;
|
|
mod logs;
|
|
mod output;
|
|
mod plan;
|
|
mod prune;
|
|
mod pull;
|
|
mod roles;
|
|
mod routes;
|
|
mod scripts;
|
|
mod secrets;
|
|
mod staleness;
|
|
mod triggers;
|