Skip to content

Commit

Permalink
fix: remove script
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin committed Jun 26, 2024
1 parent 2b1d524 commit 0d83a99
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion contrib/executor/jmeterd/build/slaves/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ EXPOSE 1099 60001
ENV SSL_DISABLED true

COPY ./contrib/executor/jmeterd/scripts/jmeter-slaves.sh /jmeter_slaves_entrypoint.sh
COPY ./contrib/executor/jmeterd/scripts/jmeter-server.sh /jmeter-server.sh
RUN chmod +x /jmeter_slaves_entrypoint.sh
ENTRYPOINT /jmeter_slaves_entrypoint.sh
10 changes: 9 additions & 1 deletion contrib/executor/jmeterd/pkg/slaves/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const (
defaultSlavesCount = 0
serverPort = 1099
localPort = 60001
logFile = "/logs/server.log"
)

func getSlaveRunnerEnv(envs map[string]string, runnerExecution testkube.Execution) []v1.EnvVar {
Expand Down Expand Up @@ -59,16 +60,23 @@ func getSlaveRunnerEnv(envs map[string]string, runnerExecution testkube.Executio

func getSlaveConfigurationEnv(slaveEnv map[string]testkube.Variable, slavesPodNumber int) []v1.EnvVar {
var envVars []v1.EnvVar
found := false
for envKey, t := range slaveEnv {
if envKey == SlavesAdditionalJmeterArgs {
if !strings.Contains(t.Value, "-j") {
t.Value += " -j /logs/server.log"
t.Value += " -j " + logFile
}

found = true
}

envVars = append(envVars, v1.EnvVar{Name: envKey, Value: t.Value})
}

if !found {
envVars = append(envVars, v1.EnvVar{Name: SlavesAdditionalJmeterArgs, Value: " -j " + logFile})
}

envVars = append(envVars, v1.EnvVar{Name: "SLAVE_POD_NUMBER", Value: strconv.Itoa(slavesPodNumber)})
return envVars
}
Expand Down
4 changes: 2 additions & 2 deletions contrib/executor/jmeterd/scripts/jmeter-slaves.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ echo "********************************************************"
echo

SERVER_ARGS="-Dserver.rmi.localport=60001 -Dserver_port=1099 -Jserver.rmi.ssl.disable=${SSL_DISABLED}"
echo "Running command: jmeter-server ${SERVER_ARGS} ${SLAVES_ADDITIONAL_JMETER_ARGS}"
echo "Running command: jmeter ${RMI_HOST_DEF} -s ${SERVER_ARGS} ${SLAVES_ADDITIONAL_JMETER_ARGS}"
echo

/jmeter-server.sh ${SERVER_ARGS} ${SLAVES_ADDITIONAL_JMETER_ARGS}
jmeter ${RMI_HOST_DEF} -s ${SERVER_ARGS} ${SLAVES_ADDITIONAL_JMETER_ARGS}

0 comments on commit 0d83a99

Please sign in to comment.