Skip to content

Commit 8c35903

Browse files
authored
[Rndstroppy-51] workloads reorganization (#24)
* feat(tests): examples -> workloads Closes RNDSTROPPY-51 * fix(linter): auto fix Closes RNDSTROPPY-51 * feat(workloads): streamed copy files Closes RNDSTROPPY-51 * fix(linter): auto fix Closes RNDSTROPPY-51 * fix(tests): fix test, skip unrelated error Closes RNDSTROPPY-51 * fix(tests): linter Closes RNDSTROPPY-51
1 parent b227caf commit 8c35903

29 files changed

+305
-706
lines changed

cmd/stroppy/commands/gen/new.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
"github.com/spf13/cobra"
1212
"go.uber.org/zap"
1313

14-
"github.com/stroppy-io/stroppy/examples"
1514
"github.com/stroppy-io/stroppy/internal/common"
1615
"github.com/stroppy-io/stroppy/internal/static"
1716
"github.com/stroppy-io/stroppy/pkg/common/logger"
17+
"github.com/stroppy-io/stroppy/workloads"
1818
)
1919

2020
const (
@@ -41,7 +41,7 @@ Examples:
4141
stroppy gen --workdir ./my-benchmark
4242
stroppy gen --workdir ./my-benchmark --preset tpcc
4343
stroppy gen --workdir ./my-benchmark --preset execute_sql
44-
`, strings.Join(examples.AvailablePresets(), ", ")),
44+
`, strings.Join(workloads.AvailablePresets(), ", ")),
4545
RunE: func(cmd *cobra.Command, _ []string) error {
4646
log := logger.Global().WithOptions(zap.WithCaller(false))
4747

@@ -75,8 +75,8 @@ Examples:
7575

7676
// Copy preset if specified
7777
if preset != "" {
78-
presetType := examples.Preset(preset)
79-
err = examples.CopyPresetToPath(output, presetType, common.FileMode)
78+
presetType := workloads.Preset(preset)
79+
err = workloads.CopyPresetToPath(output, presetType, common.FileMode)
8080
if err != nil {
8181
return fmt.Errorf("failed to copy preset: %w", err)
8282
}
@@ -118,7 +118,9 @@ Examples:
118118
)
119119

120120
// Log usage instructions
121-
log.Info("Files included: stroppy.pb.ts, stroppy.pb.js, helpers.ts, parse_sql.ts, package.json, stroppy-k6, stroppy")
121+
log.Info(
122+
"Files included: stroppy.pb.ts, stroppy.pb.js, helpers.ts, parse_sql.ts, package.json, stroppy-k6, stroppy",
123+
)
122124

123125
if preset != "" {
124126
log.Info("Preset files included", zap.String("preset", preset))
@@ -141,6 +143,6 @@ func init() { //nolint: gochecknoinits // allow in cmd
141143
Cmd.PersistentFlags().String(
142144
presetFlagName,
143145
"",
144-
fmt.Sprintf("preset example to include (%s)", strings.Join(examples.AvailablePresets(), ", ")),
146+
fmt.Sprintf("preset example to include (%s)", strings.Join(workloads.AvailablePresets(), ", ")),
145147
)
146148
}

cmd/xk6air/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (i *XK6Instance) DefineConfigBin(configBin []byte) {
151151

152152
// DefineConfig initializes the driver from GlobalConfig.
153153
// This is called by scripts using defineConfig(globalConfig) at the top level.
154-
func (i *XK6Instance) DefineConfig(globalCfg stroppy.GlobalConfig) {
154+
func (i *XK6Instance) DefineConfig(globalCfg *stroppy.GlobalConfig) {
155155

156156
drvCfg := globalCfg.GetDriver()
157157
if drvCfg == nil {
@@ -167,7 +167,7 @@ func (i *XK6Instance) DefineConfig(globalCfg stroppy.GlobalConfig) {
167167
rootModule.cloudClient.NotifyRun(rootModule.ctx, &stroppy.StroppyRun{
168168
Id: &stroppy.Ulid{Value: rootModule.runULID.String()},
169169
Status: stroppy.Status_STATUS_RUNNING,
170-
Config: &stroppy.ConfigFile{Global: &globalCfg},
170+
Config: &stroppy.ConfigFile{Global: globalCfg},
171171
Cmd: "",
172172
})
173173
})

examples/embed.go

Lines changed: 0 additions & 109 deletions
This file was deleted.

examples/open.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)