Skip to content

Commit

Permalink
Exposes expected number of workers to JMeter master pod
Browse files Browse the repository at this point in the history
Part of the fix for hellofresh#332
  • Loading branch information
thiagoarrais committed Dec 11, 2024
1 parent 4c11de6 commit 08bae14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/backends/jmeter/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"io"
"os"
"strconv"
"strings"

"go.uber.org/zap"
Expand Down Expand Up @@ -375,6 +376,10 @@ func (b *Backend) NewJMeterMasterJob(loadTest loadTestV1.LoadTest, reportURL str
Name: "WORKER_SVC_NAME",
Value: loadTestWorkerServiceName,
},
{
Name: "WORKER_TOTAL",
Value: strconv.Itoa(int(*loadTest.Spec.DistributedPods)),
},
{
Name: "USE_WORKERS",
Value: "true",
Expand Down
2 changes: 2 additions & 0 deletions pkg/backends/jmeter/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func TestGetNamespaceFromInvalidName(t *testing.T) {
}

func TestPodResourceConfiguration(t *testing.T) {
var two int32 = 2
lt := loadTestV1.LoadTest{
Spec: loadTestV1.LoadTestSpec{
MasterConfig: loadTestV1.ImageDetails{
Expand All @@ -116,6 +117,7 @@ func TestPodResourceConfiguration(t *testing.T) {
Image: defaultWorkerImageName,
Tag: defaultWorkerImageTag,
},
DistributedPods: &two,
},
}

Expand Down

0 comments on commit 08bae14

Please sign in to comment.