A bundle nothing would deliver is refused at registration (hq issue 216)
The composer delivers a bundle when the runtime loads from it, a resource names it, or it is the runtime; one reached by none of them was built, recorded and pushed as success and was simply absent. Seven modules' tools went missing that way. Refused at registration, naming the field that would deliver it.
This commit is contained in:
@@ -389,3 +389,28 @@ func TestARuntimeCompiledToABinaryRunsItself(t *testing.T) {
|
||||
t.Errorf("the Go runtime is not told what to serve or whose it is: %v %v", env, process["user"])
|
||||
}
|
||||
}
|
||||
|
||||
// novox/hq 04-ISSUES/216: a bundle nothing loads, runs or unpacks is refused at registration; saying
|
||||
// `loads`, listing `tools`, or a resource naming it admits it.
|
||||
func TestABundleNothingDeliversIsRefused(t *testing.T) {
|
||||
base := func() Manifest {
|
||||
return Manifest{Module: "baserow", Version: "1", Build: &Build{Artifacts: []Artifact{
|
||||
{Name: "tools", Kind: ArtifactBundle, Language: "typescript", Entrypoints: []string{"tools/index.js"}}}}}
|
||||
}
|
||||
if p := undeliveredBundles(base()); len(p) != 1 || !strings.Contains(p[0], "never reach a machine") {
|
||||
t.Fatalf("a bundle nothing delivers was admitted: %v", p)
|
||||
}
|
||||
loads := base()
|
||||
loads.Build.Artifacts[0].Loads = []string{"tools/index.js"}
|
||||
tools := base()
|
||||
tools.Tools = []string{"baserow_list_rows"}
|
||||
run := base()
|
||||
run.Resources = []map[string]any{{"id": "daemon", "type": "process", "artifact": "tools", "run": []any{"node", "tools/index.js"}}}
|
||||
runtime := base()
|
||||
runtime.Module = RuntimeModule
|
||||
for name, m := range map[string]Manifest{"loads": loads, "tools": tools, "a process": run, "the runtime": runtime} {
|
||||
if p := undeliveredBundles(m); len(p) != 0 {
|
||||
t.Errorf("a bundle delivered by %s was refused: %v", name, p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user