Skip to content

Conversation

yokawasa
Copy link
Contributor

Description

Support Additional printer columns for Gatling CR so that useful Gatling status will be displayed with kubectl get gatling <name> command

For example, currently kubectl get gatling <name> only display like this:

kubectl get gatling gatling-sample01

NAME               AGE
gatling-sample01   97m

With this update, kubectl get gatling <name> will display like this (more useful information for users):

NAME               RUNNED   REPORTED   NOTIFIED   REPORTURL                                                                                 AGE
gatling-sample01   3/3      true       true       https://my-test-report.s3.amazonaws.com/gatling-sample01/3499717572/index.html   3m50s

Testing

case1: runner of parallelism 3 with no report + no notification pattern

  1. prepare testing Gatling CR where reporting is enabled

base gatling CR is this.

config/samples/gatling-operator_v1alpha1_gatling01.yaml

apiVersion: gatling-operator.tech.zozo.com/v1alpha1
kind: Gatling
metadata:
  name: gatling-sample01
spec:
  generateReport: false
  generateLocalReport: false
  notifyReport: false
  cleanupAfterJobDone: false

apply the manifest and see the result


# apply the manifest
kustomize build config/samples  | kubectl apply -f -

# check the gatling cr and it's status
kubectl get gatling gatling-sample01
kubectl get gatling gatling-sample01 -o jsonpath='{@.status}' |jq

Check if new additional printer columns are displayed

kubectl get gatling gatling-sample01

NAME               RUNNED   REPORTED   NOTIFIED   REPORTURL                                                                                 AGE
gatling-sample01   3/3                            https://my-test-reports-0001.s3.amazonaws.com/gatling-sample01/3499717572/index.html   2m59s

Check if runnerCompletions field is added in Gatling CR status

kubectl get gatling gatling-sample01 -o jsonpath='{@.status}' |jq

{
  "reportStoragePath": "s3:my-test-reports-0001/gatling-sample01/3499717572",
  "reportUrl": "https://my-test-reports-0001.s3.amazonaws.com/gatling-sample01/3499717572/index.html",
  "reporterJobName": "gatling-sample01-reporter",
  "reporterStartTime": 1669533890,
  "runnerCompleted": true,
  "runnerCompletions": "3/3",
  "runnerJobName": "gatling-sample01-runner",
  "runnerStartTime": 1669533727,
  "succeeded": 3
}

case2: Runner of parallelism 3 with report + notification pattern

base gatling CR is this.

config/samples/gatling-operator_v1alpha1_gatling01.yaml

apiVersion: gatling-operator.tech.zozo.com/v1alpha1
kind: Gatling
metadata:
  name: gatling-sample01
spec:
  generateReport: true
  generateLocalReport: false
  notifyReport: true
  cleanupAfterJobDone: false

apply the manifest and see the result


# apply the manifest
kustomize build config/samples  | kubectl apply -f -

# check the gatling cr and it's status
kubectl get gatling gatling-sample01
kubectl get gatling gatling-sample01 -o jsonpath='{@.status}' |jq

Check if new additional printer columns are displayed

kubectl get gatling gatling-sample01

NAME               RUNNED   REPORTED   NOTIFIED   REPORTURL                                                                                 AGE
gatling-sample01   3/3      true       true       https://my-test-report-0001.s3.amazonaws.com/gatling-sample01/3499717572/index.html   3m50s

Check if runnerCompletions field is added in Gatling CR status

kubectl get gatling gatling-sample01 -o jsonpath='{@.status}' |jq

{
  "reportCompleted": true,
  "reportStoragePath": "s3:my-gatling-reports-0001/gatling-sample01/3499717572",
  "reportUrl": "https://my-gatling-reports-0001.s3.amazonaws.com/gatling-sample01/3499717572/index.html",
  "reporterJobName": "gatling-sample01-reporter",
  "reporterStartTime": 1669533890,
  "runnerCompleted": true,
  "runnerCompletions": "3/3",
  "runnerJobName": "gatling-sample01-runner",
  "runnerStartTime": 1669533727,
  "NotificationCompleted": true,
  "succeeded": 3
}

Checklist

Please check if applicable

  • Tests have been added NOTE no test code added for now as it's the command output need to be checked in client side, but it'll be added when e2e tests are added
  • Relevant docs have been added or modified (if applicable, ie. when new features are added or current features are modified)

Relevant issue #

#50

Signed-off-by: Yoichi Kawasaki <yokawasa@gmail.com>
…columns

Signed-off-by: Yoichi Kawasaki <yokawasa@gmail.com>
@yokawasa yokawasa requested review from S-mishina, ksudate, akitok, ikuwow and a team November 28, 2022 01:42
@@ -49,7 +49,7 @@ deployment.apps/gatling-operator-controller-manager created

All resources required for the Gatling operator, such as CRD and controller manager, are deployed using the command above. Now you're ready to deploy Gatling CR to run Gatling load testing.

The command above applies a Gatling Operator manifest of v0.5.0. Please change the version if necessary. You can check the version from the [Release page](https://github.com/st-tech/gatling-operator/releases).
The command above applies a Gatling Operator manifest of v0.9.0. Please change the version if necessary. You can check the version from the [Release page](https://github.com/st-tech/gatling-operator/releases).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v0.9.0 is going to be the next release version.

Comment on lines +88 to +90
pod/gatling-sample01-runner-8rhl4 2/2 Running 0 24s
pod/gatling-sample01-runner-cg8rt 2/2 Running 0 24s
pod/gatling-sample01-runner-tkplh 2/2 Running 0 24s
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatling runner Pod is no longer a single container but multi-containers from this update #65

Signed-off-by: Yoichi Kawasaki <yokawasa@gmail.com>
Copy link
Contributor

@akitok akitok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@yokawasa
Copy link
Contributor Author

@akitok @ksudate thanks much for the review!!

@yokawasa yokawasa merged commit 8f1e109 into main Nov 29, 2022
@yokawasa yokawasa deleted the add-print-columns branch November 29, 2022 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants