Skip to content

Commit

Permalink
fix: post-merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jahvon committed Nov 22, 2024
1 parent 30058b9 commit 5c5078d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 29 deletions.
2 changes: 1 addition & 1 deletion cmd/internal/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func execFunc(ctx *context.Context, cmd *cobra.Command, verb executable.Verb, ar
logger.FatalErr(err)
}
dur := time.Since(startTime)
processStore, err := store.NewStore(true)
processStore, err := store.NewStore()
if err != nil {
logger.Errorf("failed clearing process store\n%v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/runner/parallel/parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func (r *parallelRunner) Exec(
return err
}
defer str.Close()
if err := str.CreateBucket(store.EnvironmentBucket()); err != nil {
return err
}
return handleExec(ctx, e, eng, parallelSpec, inputEnv, str)
}

Expand All @@ -73,9 +76,6 @@ func handleExec(
}
group.SetLimit(limit)

if err := str.CreateBucket(store.EnvironmentBucket()); err != nil {
return err
}
dm, err := str.GetAll()
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions internal/runner/serial/serial.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func (r *serialRunner) Exec(
return err
}
defer str.Close()
if err := str.CreateBucket(store.EnvironmentBucket()); err != nil {
return err
}
return handleExec(ctx, e, eng, serialSpec, inputEnv, str)
}
return fmt.Errorf("no serial executables to run")
Expand All @@ -65,9 +68,6 @@ func handleExec(
promptedEnv map[string]string,
str store.Store,
) error {
if err := str.CreateBucket(store.EnvironmentBucket()); err != nil {
return err
}
dm, err := str.GetAll()
if err != nil {
return err
Expand Down
23 changes: 1 addition & 22 deletions internal/services/store/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var _ = Describe("BoltStore", func() {
var err error

BeforeEach(func() {
s, err = store.NewStore(true)
s, err = store.NewStore()
Expect(err).NotTo(HaveOccurred())
Expect(s).NotTo(BeNil())
})
Expand Down Expand Up @@ -161,25 +161,4 @@ var _ = Describe("BoltStore", func() {
Expect(err).To(HaveOccurred())
})
})

Describe("GetAll", func() {
It("should get all key-value pairs from the bucket", func() {
err = store.SetProcessBucketID("process3", true)
err := s.CreateBucket()
Expect(err).NotTo(HaveOccurred())

err = s.Set("key1", "value1")
Expect(err).NotTo(HaveOccurred())

err = s.Set("key2", "value2")
Expect(err).NotTo(HaveOccurred())

data, err := s.GetAll()
Expect(err).NotTo(HaveOccurred())
Expect(data).To(Equal(map[string]string{
"key1": "value1",
"key2": "value2",
}))
})
})
})

0 comments on commit 5c5078d

Please sign in to comment.