Skip to content

Commit

Permalink
Merge cbcac67 into 08e8b5d
Browse files Browse the repository at this point in the history
  • Loading branch information
rm3l authored Jun 1, 2023
2 parents 08e8b5d + cbcac67 commit 655c6d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/dev/podmandev/podmandev.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/redhat-developer/odo/pkg/devfile/location"
"github.com/redhat-developer/odo/pkg/exec"
"github.com/redhat-developer/odo/pkg/libdevfile"
"github.com/redhat-developer/odo/pkg/log"
odocontext "github.com/redhat-developer/odo/pkg/odo/context"
"github.com/redhat-developer/odo/pkg/podman"
"github.com/redhat-developer/odo/pkg/portForward"
Expand Down Expand Up @@ -114,6 +115,8 @@ func (o *DevClient) syncFiles(ctx context.Context, options dev.StartOptions, pod
PodName: pod.GetName(),
SyncFolder: syncFolder,
}
s := log.Spinner("Syncing files into the container")
defer s.End(false)

cmdKind := devfilev1.RunCommandGroupKind
cmdName := options.RunCommand
Expand Down Expand Up @@ -141,6 +144,7 @@ func (o *DevClient) syncFiles(ctx context.Context, options dev.StartOptions, pod
if err != nil {
return false, err
}
s.End(true)
return execRequired, nil
}

Expand Down
20 changes: 20 additions & 0 deletions tests/integration/cmd_dev_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2567,6 +2567,9 @@ CMD ["npm", "start"]
})

It("should run successfully", func() {
By("telling the user that odo is synchronizing the files", func() {
Expect(string(stdout)).Should(ContainSubstring("Syncing files into the container"))
})
By("verifying from the output that all commands have been executed", func() {
helper.MatchAllInOutput(string(stdout), []string{
"Building your application in container",
Expand Down Expand Up @@ -2884,6 +2887,7 @@ CMD ["npm", "start"]

By("checking the output of the command", func() {
helper.MatchAllInOutput(stdout, []string{
"Syncing files into the container",
fmt.Sprintf("Building your application in container (command: %s)", tt.buildCmd),
fmt.Sprintf("Executing the application (command: %s)", tt.runCmd),
})
Expand Down Expand Up @@ -3636,6 +3640,10 @@ CMD ["npm", "start"]
It("should execute the build and run commands", func() {
Expect(string(stdout)).To(ContainSubstring(executeBuildCommand))
Expect(string(stdout)).To(ContainSubstring(executeRunCommand))

By("telling the user that odo is synchronizing the files", func() {
Expect(string(stdout)).Should(ContainSubstring("Syncing files into the container"))
})
})

When("a source file is modified", func() {
Expand All @@ -3649,6 +3657,10 @@ CMD ["npm", "start"]
It("should not re-execute the run command", func() {
Expect(string(stdout)).To(ContainSubstring(executeBuildCommand))
Expect(string(stdout)).ToNot(ContainSubstring(executeRunCommand))

By("telling the user that odo is synchronizing the files", func() {
Expect(string(stdout)).Should(ContainSubstring("Syncing files into the container"))
})
})
})
}))
Expand Down Expand Up @@ -3677,6 +3689,10 @@ CMD ["npm", "start"]
It("should execute the build and run commands", func() {
Expect(string(stdout)).To(ContainSubstring(executeBuildCommand))
Expect(string(stdout)).To(ContainSubstring(executeRunCommand))

By("telling the user that odo is synchronizing the files", func() {
Expect(string(stdout)).Should(ContainSubstring("Syncing files into the container"))
})
})

When("a source file is modified", func() {
Expand All @@ -3690,6 +3706,10 @@ CMD ["npm", "start"]
It("should not re-execute the run command", func() {
Expect(string(stdout)).ToNot(ContainSubstring(executeBuildCommand))
Expect(string(stdout)).ToNot(ContainSubstring(executeRunCommand))

By("telling the user that odo is synchronizing the files", func() {
Expect(string(stdout)).Should(ContainSubstring("Syncing files into the container"))
})
})
})
}))
Expand Down

0 comments on commit 655c6d0

Please sign in to comment.