mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-08 00:00:28 +00:00
test: speed up (#1386)
Reduce redundant fixture setup, Git subprocesses, and large data copies while preserving test coverage. Local macOS measurements against main: | Measurement | Before | After | | --- | ---: | ---: | | Git package time, median of 3 alternating runs | 4.09 s | 3.48 s (-15%) | | Allocations across 18 action-bundle cases | 489 MiB | 251 MiB (-49%) | | Traced Git starts per checkout table run | 234 | 175 | Reviewed-on: https://gitea.com/gitea/runner/pulls/1386 Reviewed-by: bircni <[email protected]>
This commit is contained in:
1 parent
664978c819
commit
30e600d8f6
28 files changed
+261
-291
No files matched your search
@@ -412,11 +412,10 @@ func TestGetEvaluatorInputsBoolean(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, eventName := range []string{"workflow_call", "workflow_dispatch"} {
|
||||
wf, err := model.ReadWorkflow(strings.NewReader(workflow(eventName)))
|
||||
require.NoError(t, err)
|
||||
for _, table := range tables {
|
||||
t.Run(eventName+"/"+table.name, func(t *testing.T) {
|
||||
wf, err := model.ReadWorkflow(strings.NewReader(workflow(eventName)))
|
||||
require.NoError(t, err)
|
||||
|
||||
rc := &RunContext{
|
||||
Config: &Config{Workdir: "."},
|
||||
Run: &model.Run{JobID: "job1", Workflow: wf},
|
||||
|
||||
Reference in new issue
Block a user