Skip to content

Commit

Permalink
Socket id passing
Browse files Browse the repository at this point in the history
  • Loading branch information
denis256 committed May 8, 2024
1 parent fbf3854 commit 6eaf671
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/action_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ func testAutoApproveDelete(t *testing.T, actionConfig ActionConfig, tag string)

func runAction(t *testing.T, actionConfig ActionConfig, sshAgent bool, tag, fixturePath string, command string) string {

logId := random.Random(1, 5000)
opts := &docker.RunOptions{
EnvironmentVariables: []string{
"INPUT_" + actionConfig.iacType + "_VERSION=" + actionConfig.iacVersion,
"INPUT_TG_VERSION=" + actionConfig.tgVersion,
"INPUT_TG_COMMAND=" + command,
"INPUT_TG_DIR=/github/workspace",
"GITHUB_OUTPUT=/tmp/github-action-logs",
fmt.Sprintf("GITHUB_OUTPUT=/tmp/github-action-logs.%d", logId),
},
Volumes: []string{
fixturePath + ":/github/workspace",
Expand All @@ -143,8 +144,8 @@ func runAction(t *testing.T, actionConfig ActionConfig, sshAgent bool, tag, fixt
}
sshPath := filepath.Join(homeDir, ".ssh")

r := random.Random(1, 1000)
socketPath := fmt.Sprintf("/tmp/ssh-agent.sock.%d", r)
socketId := random.Random(1, 5000)
socketPath := fmt.Sprintf("/tmp/ssh-agent.sock.%d", socketId)
sshAgentID := docker.RunAndGetID(t, "ssh-agent:local", &docker.RunOptions{
Detach: true,
Remove: true,
Expand Down

0 comments on commit 6eaf671

Please sign in to comment.