Skip to content

Commit

Permalink
update test to match how method is actually called
Browse files Browse the repository at this point in the history
  • Loading branch information
jenseng committed Nov 29, 2023
1 parent 6ff9851 commit 3db5ca9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/runner/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package runner

import (
"context"
"fmt"
"io"
"io/fs"
"strings"
Expand Down Expand Up @@ -224,8 +225,10 @@ func TestActionRunner(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
ctx := context.Background()

actionDir := fmt.Sprintf("%s/dir", tt.step.getRunContext().ActionCacheDir())

cm := &containerMock{}
cm.On("CopyDir", "/var/run/act/actions/dir/", "dir/", false).Return(func(ctx context.Context) error { return nil })
cm.On("CopyDir", "/var/run/act/actions/dir/", actionDir+"/", false).Return(func(ctx context.Context) error { return nil })

envMatcher := mock.MatchedBy(func(env map[string]string) bool {
for k, v := range tt.expectedEnv {
Expand All @@ -240,7 +243,7 @@ func TestActionRunner(t *testing.T) {

tt.step.getRunContext().JobContainer = cm

err := runActionImpl(tt.step, "dir", newRemoteAction("org/repo/path@ref"))(ctx)
err := runActionImpl(tt.step, actionDir, newRemoteAction("org/repo/path@ref"))(ctx)

assert.Nil(t, err)
cm.AssertExpectations(t)
Expand Down

0 comments on commit 3db5ca9

Please sign in to comment.