Skip to content

fix(tests): guard against nil RunScript result in integration tests#2934

Open
barnabasbusa wants to merge 1 commit intomainfrom
fix/nil-runresult-guard-integration-tests
Open

fix(tests): guard against nil RunScript result in integration tests#2934
barnabasbusa wants to merge 1 commit intomainfrom
fix/nil-runresult-guard-integration-tests

Conversation

@barnabasbusa
Copy link
Collaborator

Summary

  • When RunScript/RunRemotePackage returns (nil, error) due to gRPC failures (context cancelled, engine unreachable), tests that ignore the error with runResult, _ := ... and immediately access runResult.InterpretationError panic with a nil pointer dereference
  • Added require.NotNil(t, runResult, "RunScript returned nil result") guards at 12 call sites across 10 test files to produce clean test failures instead of panics
  • Two files (startosis_add_service_invalid_name_test.go and startosis_remote_package_relative_import_test.go) already had the guard and were left unchanged

Test plan

  • go vet ./... passes in internal_testsuites/golang/
  • go build ./... passes in internal_testsuites/golang/
  • Full integration test suite (requires running Kurtosis engine + k8s cluster, validated by CI)

🤖 Generated with Claude Code

When RunScript returns (nil, error) due to gRPC failures, tests that
ignore the error and immediately access runResult fields panic with a
nil pointer dereference. Add require.NotNil guards at 12 call sites
across 10 test files to produce clean test failures instead of panics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant