chore: added debug code

This commit is contained in:
Marvin Zhang
2024-11-22 09:51:34 +08:00
parent 4c0922c22f
commit be45478f0e
3 changed files with 9 additions and 13 deletions

View File

@@ -42,6 +42,7 @@ func setupTest(t *testing.T) *Runner {
// Create a test runner
svc := newTaskHandlerService()
runner, _ := newTaskRunner(task.Id, svc)
require.NotNil(t, runner)
err = runner.updateTask("", nil)
require.Nil(t, err)
_ = runner.Init()
@@ -128,13 +129,3 @@ func TestRunner_Cancel(t *testing.T) {
err = process.Signal(syscall.Signal(0))
assert.Error(t, err) // Process should not exist
}
// Helper function to create a temporary workspace for testing
func createTestWorkspace(t *testing.T) string {
dir, err := os.MkdirTemp("", "crawlab-test-*")
assert.NoError(t, err)
t.Cleanup(func() {
os.RemoveAll(dir)
})
return dir
}