J3: mesh-sdk within its test budget, each file of declaration and the provider harness one test of subtests
The unit test functions fall from 587 to 476 (the budget is 500): the cases of each of twenty test files in declaration and provider/harness become subtests of one test named for the file, under their own names, their bodies unchanged. Integration tests stay at 30 (budget 50). Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
const anImage = "docker.io/library/x@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
|
||||
// The fields ADR 0325 adds, read as the controller sends them (novox/hq ADR 0325 §2, §3, §5, issue 567).
|
||||
func TestIdentitiesUsersAndARunAsAreReadAsSent(t *testing.T) {
|
||||
func testIdentitiesUsersAndARunAsAreReadAsSent(t *testing.T) {
|
||||
d, err := Parse([]byte(`{"declaration":1,
|
||||
"identities":[{"module":"radarr","name":"mesh-radarr","uid":61001,"gid":61001}],
|
||||
"resources":[
|
||||
@@ -35,7 +35,7 @@ func TestIdentitiesUsersAndARunAsAreReadAsSent(t *testing.T) {
|
||||
|
||||
// What the engine refuses on arrival: a root number, an identity not named for its module, a field it does not
|
||||
// know, a user that writes a read access, a variable set twice.
|
||||
func TestWhatADeclarationMayNotSayOfAnIdentity(t *testing.T) {
|
||||
func testWhatADeclarationMayNotSayOfAnIdentity(t *testing.T) {
|
||||
for want, raw := range map[string]string{
|
||||
"never root": `"identities":[{"module":"m","name":"mesh-m","uid":0,"gid":61001}],"resources":[]`,
|
||||
"named mesh-<module>": `"identities":[{"module":"m","name":"m","uid":61001,"gid":61001}],` +
|
||||
@@ -59,3 +59,9 @@ func TestWhatADeclarationMayNotSayOfAnIdentity(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestIdentity holds this file's cases, each a subtest of its own name (mesh-sdk's test budget: at most 500 unit tests).
|
||||
func TestIdentity(t *testing.T) {
|
||||
t.Run("IdentitiesUsersAndARunAsAreReadAsSent", testIdentitiesUsersAndARunAsAreReadAsSent)
|
||||
t.Run("WhatADeclarationMayNotSayOfAnIdentity", testWhatADeclarationMayNotSayOfAnIdentity)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user