diff --git a/.gitignore b/.gitignore
index 10790fb..c4b5bd6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,8 @@ example
.DS_STORE
example-server-bootstrap
-*.db
-db
-example
\ No newline at end of file
+example
+
+
+*_templ.go
+handoff.db
diff --git a/internal/html/component/test_run_table.templ b/internal/html/component/test_run_table.templ
new file mode 100644
index 0000000..60c9603
--- /dev/null
+++ b/internal/html/component/test_run_table.templ
@@ -0,0 +1,48 @@
+package component
+
+import (
+ "fmt"
+
+ "github.com/raphi011/handoff/internal/model"
+)
+
+templ TestRunTable(tsr model.TestSuiteRun) {
+
+
+
+
+
+
+
+ Name |
+ Status |
+ Duration |
+
+
+
+ for _, tr := range tsr.TestResults {
+
+ { tr.Name } |
+ if tr.Result == "passed" {
+
+ } else {
+
+ }
+ if tr.SoftFailure {
+ (soft failure)
+ } |
+ { fmt.Sprintf("%dms", tr.DurationInMS) } |
+
+
+ }
+
+
+
+
+
+
+}
diff --git a/internal/html/test-run.templ b/internal/html/test-run.templ
index 7557d65..a479bd3 100644
--- a/internal/html/test-run.templ
+++ b/internal/html/test-run.templ
@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/raphi011/handoff/internal/model"
+ "github.com/raphi011/handoff/internal/html/component"
)
templ RenderTestRun(tr model.TestRun) {
@@ -30,29 +31,8 @@ templ RenderTestSuiteRun(tsr model.TestSuiteRun) {
{ tsr.SuiteName }
Started at { tsr.Start.Format("02.01 15:04:05") }, took { fmt.Sprintf("%d", tsr.DurationInMS) }ms to finish.
Is flaky: { fmt.Sprintf("%t", tsr.Flaky) }
-
-
- Name |
- Passed |
- Duration |
-
- for _, tr := range tsr.TestResults {
-
- { tr.Name } |
-
- if tr.Result == "passed" {
- ✅
- } else {
- ❌
- }
- if tr.SoftFailure {
- (soft failure)
- }
- |
- { fmt.Sprintf("%dms", tr.DurationInMS) } |
-
- }
-
+
+ @component.TestRunTable(tsr)
}
}
@@ -86,7 +66,8 @@ templ body() {
-
+
+
Handoff
diff --git a/internal/html/test-run_templ.go b/internal/html/test-run_templ.go
index 648dd7b..cd68e31 100644
--- a/internal/html/test-run_templ.go
+++ b/internal/html/test-run_templ.go
@@ -1,546 +1,471 @@
-// Code generated by templ - DO NOT EDIT.
+// Code generated by templ@v0.2.364 DO NOT EDIT.
-// templ: version: v0.2.793
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
-import templruntime "github.com/a-h/templ/runtime"
+import "context"
+import "io"
+import "bytes"
import (
"fmt"
+ "github.com/raphi011/handoff/internal/html/component"
"github.com/raphi011/handoff/internal/model"
)
func RenderTestRun(tr model.TestRun) templ.Component {
- return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
- return templ_7745c5c3_CtxErr
- }
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
+ return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Var1 := templ.GetChildren(ctx)
- if templ_7745c5c3_Var1 == nil {
- templ_7745c5c3_Var1 = templ.NopComponent
+ var_1 := templ.GetChildren(ctx)
+ if var_1 == nil {
+ var_1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
- }
- ctx = templ.InitializeContext(ctx)
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var3 string
- templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(tr.Name)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 11, Col: 16}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Logs
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var4 string
- templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(tr.Logs)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 13, Col: 17}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- return templ_7745c5c3_Err
+ var_2 := templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
+ }
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
+ }
+ var var_3 string = tr.Name
+ _, err = templBuffer.WriteString(templ.EscapeString(var_3))
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
+ }
+ var_4 := `Logs`
+ _, err = templBuffer.WriteString(var_4)
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
+ }
+ var var_5 string = tr.Logs
+ _, err = templBuffer.WriteString(templ.EscapeString(var_5))
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
+ }
+ if !templIsBuffer {
+ _, err = io.Copy(w, templBuffer)
+ }
+ return err
})
- templ_7745c5c3_Err = body().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ err = body().Render(templ.WithChildren(ctx, var_2), templBuffer)
+ if err != nil {
+ return err
}
- return templ_7745c5c3_Err
+ if !templIsBuffer {
+ _, err = templBuffer.WriteTo(w)
+ }
+ return err
})
}
func RenderSchedules(schedules []model.ScheduledRun) templ.Component {
- return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
- return templ_7745c5c3_CtxErr
- }
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
+ return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Var5 := templ.GetChildren(ctx)
- if templ_7745c5c3_Var5 == nil {
- templ_7745c5c3_Var5 = templ.NopComponent
+ var_6 := templ.GetChildren(ctx)
+ if var_6 == nil {
+ var_6 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
- }
- ctx = templ.InitializeContext(ctx)
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Scheduled runs
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ var_7 := templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
+ }
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
+ }
+ var_8 := `Scheduled runs`
+ _, err = templBuffer.WriteString(var_8)
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
}
for _, s := range schedules {
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("- ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var7 string
- templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(s.Name)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 22, Col: 16}
+ _, err = templBuffer.WriteString("
- ")
+ if err != nil {
+ return err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ var var_9 string = s.Name
+ _, err = templBuffer.WriteString(templ.EscapeString(var_9))
+ if err != nil {
+ return err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
}
- return templ_7745c5c3_Err
+ if !templIsBuffer {
+ _, err = io.Copy(w, templBuffer)
+ }
+ return err
})
- templ_7745c5c3_Err = body().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ err = body().Render(templ.WithChildren(ctx, var_7), templBuffer)
+ if err != nil {
+ return err
+ }
+ if !templIsBuffer {
+ _, err = templBuffer.WriteTo(w)
}
- return templ_7745c5c3_Err
+ return err
})
}
func RenderTestSuiteRun(tsr model.TestSuiteRun) templ.Component {
- return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
- return templ_7745c5c3_CtxErr
- }
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
+ return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Var8 := templ.GetChildren(ctx)
- if templ_7745c5c3_Var8 == nil {
- templ_7745c5c3_Var8 = templ.NopComponent
+ var_10 := templ.GetChildren(ctx)
+ if var_10 == nil {
+ var_10 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var9 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
- }
- ctx = templ.InitializeContext(ctx)
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var10 string
- templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(tsr.SuiteName)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 30, Col: 21}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Started at ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var11 string
- templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(tsr.Start.Format("02.01 15:04:05"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 31, Col: 52}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", took ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var12 string
- templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", tsr.DurationInMS))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 31, Col: 98}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("ms to finish.
Is flaky: ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var13 string
- templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%t", tsr.Flaky))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 32, Col: 46}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Name | Passed | Duration |
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- for _, tr := range tsr.TestResults {
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var15 string
- templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(tr.Name)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 41, Col: 114}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" | ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- if tr.Result == "passed" {
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("✅ ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- } else {
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("❌ ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- if tr.SoftFailure {
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("(soft failure)")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" | ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var16 string
- templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%dms", tr.DurationInMS))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 52, Col: 73}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" |
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- return templ_7745c5c3_Err
+ var_11 := templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
+ }
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
+ }
+ var var_12 string = tsr.SuiteName
+ _, err = templBuffer.WriteString(templ.EscapeString(var_12))
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
+ }
+ var_13 := `Started at `
+ _, err = templBuffer.WriteString(var_13)
+ if err != nil {
+ return err
+ }
+ var var_14 string = tsr.Start.Format("02.01 15:04:05")
+ _, err = templBuffer.WriteString(templ.EscapeString(var_14))
+ if err != nil {
+ return err
+ }
+ var_15 := `, took `
+ _, err = templBuffer.WriteString(var_15)
+ if err != nil {
+ return err
+ }
+ var var_16 string = fmt.Sprintf("%d", tsr.DurationInMS)
+ _, err = templBuffer.WriteString(templ.EscapeString(var_16))
+ if err != nil {
+ return err
+ }
+ var_17 := `ms to finish.`
+ _, err = templBuffer.WriteString(var_17)
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
+ }
+ var_18 := `Is flaky: `
+ _, err = templBuffer.WriteString(var_18)
+ if err != nil {
+ return err
+ }
+ var var_19 string = fmt.Sprintf("%t", tsr.Flaky)
+ _, err = templBuffer.WriteString(templ.EscapeString(var_19))
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
+ }
+ err = component.TestRunTable(tsr).Render(ctx, templBuffer)
+ if err != nil {
+ return err
+ }
+ if !templIsBuffer {
+ _, err = io.Copy(w, templBuffer)
+ }
+ return err
})
- templ_7745c5c3_Err = body().Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ err = body().Render(templ.WithChildren(ctx, var_11), templBuffer)
+ if err != nil {
+ return err
}
- return templ_7745c5c3_Err
+ if !templIsBuffer {
+ _, err = templBuffer.WriteTo(w)
+ }
+ return err
})
}
func RenderTestSuiteRuns(runs []model.TestSuiteRun) templ.Component {
- return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
- return templ_7745c5c3_CtxErr
- }
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
+ return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Var17 := templ.GetChildren(ctx)
- if templ_7745c5c3_Var17 == nil {
- templ_7745c5c3_Var17 = templ.NopComponent
+ var_20 := templ.GetChildren(ctx)
+ if var_20 == nil {
+ var_20 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var18 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
- }
- ctx = templ.InitializeContext(ctx)
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Testruns
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ var_21 := templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
+ }
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
+ }
+ var_22 := `Testruns`
+ _, err = templBuffer.WriteString(var_22)
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
}
for _, tsr := range runs {
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("- ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ var var_23 templ.SafeURL = templ.URL(fmt.Sprintf("/suites/%s/runs/%d", tsr.SuiteName, tsr.ID))
+ _, err = templBuffer.WriteString(templ.EscapeString(string(var_23)))
+ if err != nil {
+ return err
}
- var templ_7745c5c3_Var20 string
- templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(tsr.SuiteName)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 65, Col: 100}
+ _, err = templBuffer.WriteString("\">")
+ if err != nil {
+ return err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ var var_24 string = tsr.SuiteName
+ _, err = templBuffer.WriteString(templ.EscapeString(var_24))
+ if err != nil {
+ return err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" (#")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ _, err = templBuffer.WriteString(" ")
+ if err != nil {
+ return err
}
- var templ_7745c5c3_Var21 string
- templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", tsr.ID))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 65, Col: 132}
+ var_25 := `(#`
+ _, err = templBuffer.WriteString(var_25)
+ if err != nil {
+ return err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ var var_26 string = fmt.Sprintf("%d", tsr.ID)
+ _, err = templBuffer.WriteString(templ.EscapeString(var_26))
+ if err != nil {
+ return err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("): ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ var_27 := `): `
+ _, err = templBuffer.WriteString(var_27)
+ if err != nil {
+ return err
}
- var templ_7745c5c3_Var22 string
- templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(string(tsr.Result))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 65, Col: 157}
+ var var_28 string = string(tsr.Result)
+ _, err = templBuffer.WriteString(templ.EscapeString(var_28))
+ if err != nil {
+ return err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
+ }
+ if !templIsBuffer {
+ _, err = io.Copy(w, templBuffer)
}
- return templ_7745c5c3_Err
+ return err
})
- templ_7745c5c3_Err = body().Render(templ.WithChildren(ctx, templ_7745c5c3_Var18), templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ err = body().Render(templ.WithChildren(ctx, var_21), templBuffer)
+ if err != nil {
+ return err
+ }
+ if !templIsBuffer {
+ _, err = templBuffer.WriteTo(w)
}
- return templ_7745c5c3_Err
+ return err
})
}
func RenderTestSuites(suites []model.TestSuite) templ.Component {
- return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
- return templ_7745c5c3_CtxErr
- }
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
+ return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Var23 := templ.GetChildren(ctx)
- if templ_7745c5c3_Var23 == nil {
- templ_7745c5c3_Var23 = templ.NopComponent
+ var_29 := templ.GetChildren(ctx)
+ if var_29 == nil {
+ var_29 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Var24 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
- }
- ctx = templ.InitializeContext(ctx)
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Test suites
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ var_30 := templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
+ }
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
+ }
+ var_31 := `Test suites`
+ _, err = templBuffer.WriteString(var_31)
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
}
for _, ts := range suites {
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("- ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ _, err = templBuffer.WriteString("\">")
+ if err != nil {
+ return err
}
- var templ_7745c5c3_Var26 string
- templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(ts.Name)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/html/test-run.templ`, Line: 78, Col: 77}
+ var var_33 string = ts.Name
+ _, err = templBuffer.WriteString(templ.EscapeString(var_33))
+ if err != nil {
+ return err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
+ }
+ if !templIsBuffer {
+ _, err = io.Copy(w, templBuffer)
}
- return templ_7745c5c3_Err
+ return err
})
- templ_7745c5c3_Err = body().Render(templ.WithChildren(ctx, templ_7745c5c3_Var24), templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ err = body().Render(templ.WithChildren(ctx, var_30), templBuffer)
+ if err != nil {
+ return err
}
- return templ_7745c5c3_Err
+ if !templIsBuffer {
+ _, err = templBuffer.WriteTo(w)
+ }
+ return err
})
}
func body() templ.Component {
- return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
- templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
- if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
- return templ_7745c5c3_CtxErr
- }
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
- if !templ_7745c5c3_IsBuffer {
- defer func() {
- templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err == nil {
- templ_7745c5c3_Err = templ_7745c5c3_BufErr
- }
- }()
+ return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
+ templBuffer, templIsBuffer := w.(*bytes.Buffer)
+ if !templIsBuffer {
+ templBuffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templBuffer)
}
ctx = templ.InitializeContext(ctx)
- templ_7745c5c3_Var27 := templ.GetChildren(ctx)
- if templ_7745c5c3_Var27 == nil {
- templ_7745c5c3_Var27 = templ.NopComponent
+ var_34 := templ.GetChildren(ctx)
+ if var_34 == nil {
+ var_34 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Handoff
")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
}
- return templ_7745c5c3_Err
+ var_36 := `Handoff`
+ _, err = templBuffer.WriteString(var_36)
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("
")
+ if err != nil {
+ return err
+ }
+ err = var_34.Render(ctx, templBuffer)
+ if err != nil {
+ return err
+ }
+ _, err = templBuffer.WriteString("")
+ if err != nil {
+ return err
+ }
+ if !templIsBuffer {
+ _, err = templBuffer.WriteTo(w)
+ }
+ return err
})
}
-
-var _ = templruntime.GeneratedTemplate