- Introduced unit tests for the main package to ensure compilation. - Added tests for the manager, including validation of upload sessions and handling of Blender binary paths. - Implemented tests for job token generation and validation, ensuring security and integrity. - Created tests for configuration management and database schema to verify functionality. - Added tests for logger and runner components to enhance overall test coverage and reliability.
29 lines
670 B
Go
29 lines
670 B
Go
package tasks
|
|
|
|
import "testing"
|
|
|
|
func TestCheckGPUErrorLine_TriggersCallback(t *testing.T) {
|
|
p := NewRenderProcessor()
|
|
triggered := false
|
|
ctx := &Context{
|
|
OnGPUError: func() { triggered = true },
|
|
}
|
|
p.checkGPUErrorLine(ctx, "Fatal: Illegal address in HIP kernel execution")
|
|
if !triggered {
|
|
t.Fatal("expected GPU error callback to be triggered")
|
|
}
|
|
}
|
|
|
|
func TestCheckGPUErrorLine_IgnoresNormalLine(t *testing.T) {
|
|
p := NewRenderProcessor()
|
|
triggered := false
|
|
ctx := &Context{
|
|
OnGPUError: func() { triggered = true },
|
|
}
|
|
p.checkGPUErrorLine(ctx, "Render completed successfully")
|
|
if triggered {
|
|
t.Fatal("did not expect GPU callback for normal line")
|
|
}
|
|
}
|
|
|