Skip to content
quarry Artifact [698ca180bd]
Login

Artifact [698ca180bd]

Artifact 698ca180bdba6fe0708072c80359e5530fc5f9a8391699e6a688da71b82c97f5:


package api

import (
	"context"
	"testing"

	"craftdesign.group/quarry/internal/ops"
)

// A person signed in builds on the reader lane; a runner reading with
// a sync or run token is CI's work and keeps the lane it had unsigned.
func TestARunnersArchiveKeepsItsLane(t *testing.T) {
	person := ops.WithUser(context.Background(), "dan")
	runner := ops.WithArchiveReader(person, "repo")
	if !readerLane(person) {
		t.Errorf("FAIL: a signed-in person is not on the reader lane")
	}
	if readerLane(runner) || readerLane(context.Background()) {
		t.Errorf("FAIL: a token reader or an anonymous one is on the reader lane")
	}
	if !t.Failed() {
		t.Log("ok")
	}
}