Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/commands/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Task done.

Give feedback on our teamwork (you and me) also from the perspective of a human teammate. There is no need write a handoff.

Write that to ./.feedback/$(date +%Y%m%d-%H%M%S).md (terse for me only it is gitignored).
Write that to ./work/feedback/$(date +%Y%m%d-%H%M%S).md (terse for me only it is gitignored).
3 changes: 3 additions & 0 deletions .containerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Scratch area: design notes, vendored sources, test logs and coverage
work/
.git/
1 change: 1 addition & 0 deletions .dockerignore
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

.mcp.json

test/logs/*
!test/logs/.gitkeep

.feedback/*

work/

# Its generated with random host only data, still no need to commit.
Expand Down
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ discussable - always ask before guessing.

- Code comments should be no longer than one line, unless they are required to cover complex unintuitive logic.
- Never explain previous behaviour in comments.
- Comments are not safeguards, they are informal. An API is safe to use from several goroutines because it is mutex-free or confined to one, never because a comment says it is.
- Commit messages should similarly be kept as short and to the point as possible, no need to summarize the whole issue. Keep the conventional `<type>(<scope>): <description>` format from CONTRIBUTING.md.
- Do not use `go vet`, `gci` or any of those diagnostics tools, use gopls.
- You don't need to capture tests on your own use `just test-log` to get the last log.
Expand Down Expand Up @@ -58,6 +59,7 @@ commands instead of raw `go` (see `just --list`).
## Working in this repo

- Check existing patterns in the codebase before creating new ones.
- In most cases we do not enforce security by comments, we enforce by code and architecture.
- Think through framework/library behavior before coding.
- Keep code direct - no unnecessary intermediate variables; use `_` for unused parameters.
- If cycling (same approach, no progress), stop and ask.
Expand Down
29 changes: 12 additions & 17 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/lxc/incus-compose/testlib"
)

func TestMain(m *testing.M) {
Expand All @@ -24,13 +26,6 @@ func TestMain(m *testing.M) {
os.Exit(code)
}

func skipLocal(t *testing.T) {
t.Helper()
if os.Getenv("INCUS_COMPOSE_TEST_LOCAL") != "" {
t.Skip("Skipping: env INCUS_COMPOSE_TEST_LOCAL is set, run `just test` for this test")
}
}

// newRandomTestClient creates a GlobalClient, a fresh project-scoped Client,
// and registers t.Cleanup to delete the project on teardown.
func newRandomTestClient(_ context.Context, t *testing.T, prefix string) *Client {
Expand Down Expand Up @@ -145,7 +140,7 @@ func TestSanitizeProjectName(t *testing.T) {

func TestClientConnection_IsConnected(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand All @@ -154,7 +149,7 @@ func TestClientConnection_IsConnected(t *testing.T) {

func TestClientProject_GlobalClientKeepsDefaultProfile(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand All @@ -180,7 +175,7 @@ func TestClientProject_GlobalClientKeepsDefaultProfile(t *testing.T) {

func TestClientProject_ImageCacheIsInCacheProfile(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand All @@ -196,7 +191,7 @@ func TestClientProject_ImageCacheIsInCacheProfile(t *testing.T) {

func TestClientProject_EnsureWithCreate(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand All @@ -210,7 +205,7 @@ func TestClientProject_EnsureWithCreate(t *testing.T) {

func TestClientProject_EnsureWithoutCreate_Fails(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand All @@ -222,7 +217,7 @@ func TestClientProject_EnsureWithoutCreate_Fails(t *testing.T) {

func TestClientProject_NameIsPreserved(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand All @@ -236,7 +231,7 @@ func TestClientProject_NameIsPreserved(t *testing.T) {

func TestClientProject_NameIsSanitized(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand All @@ -252,7 +247,7 @@ func TestClientProject_NameIsSanitized(t *testing.T) {

func TestClientProject_EnsureIdempotent(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand All @@ -268,7 +263,7 @@ func TestClientProject_EnsureIdempotent(t *testing.T) {

func TestClientProject_DeleteSucceeds(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand All @@ -282,7 +277,7 @@ func TestClientProject_DeleteSucceeds(t *testing.T) {

func TestClientProject_DeleteNonExistent_NoError(t *testing.T) {
t.Parallel()
skipLocal(t)
testlib.SkipLocal(t)
ctx := t.Context()
gc, err := NewTestClient(ctx)
require.NoError(t, err)
Expand Down
Loading