Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pv support #109

Merged
merged 9 commits into from
Mar 28, 2024
Merged

Add pv support #109

merged 9 commits into from
Mar 28, 2024

Conversation

kane8n
Copy link
Contributor

@kane8n kane8n commented Mar 1, 2024

Description

Provide a description of what has been changed

  • Allow GatlingOperator to create persistent volumes that can be referenced from scenarios

Checklist

Please check if applicable

  • Tests have been added (if applicable, ie. when operator codes are added or modified)
  • Relevant docs have been added or modified (if applicable, ie. when new features are added or current features are modified)

Relevant issue #

@kane8n kane8n requested a review from a team March 1, 2024 11:08
controllers/gatling_controller.go Outdated Show resolved Hide resolved
controllers/gatling_controller.go Show resolved Hide resolved
controllers/gatling_controller.go Outdated Show resolved Hide resolved
controllers/gatling_controller.go Outdated Show resolved Hide resolved
| Field | Description |
| --- | --- |
| `name` _string_ | (Required) The name of the PersistentVolumeClaim. |
| `spec` _[PersistentVolumeClaimSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#persistentvolumeclaimspec-v1-core)_ | (Required) PersistentVolumeClaimSpec is the specification of a persistent volume. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately the links seem not valid.
We had better make another issue.

docs/user-guide.md Outdated Show resolved Hide resolved
@gold-kou
Copy link
Contributor

gold-kou commented Mar 5, 2024

Could you add PV and PVC properties to existing tests in gatling_controller_test.go ?

@kane8n
Copy link
Contributor Author

kane8n commented Mar 12, 2024

Thanks for the review!
Corrected points raised in review comments and added testing and documentation.

@kane8n kane8n requested a review from gold-kou March 12, 2024 06:08
@@ -84,5 +86,99 @@ var _ = Context("Inside of a new namespace", func() {
Expect(job.Spec.Completions).Should(Equal(pointer.Int32Ptr(2)))
})

It("shoud create a New Gatling resource with PersistentVolume resources", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

shoud -> should

ctx, client.ObjectKey{Namespace: ns.Name, Name: "resource-pvc"}, pvc)
}).Should(Succeed())
})

Copy link
Contributor

Choose a reason for hiding this comment

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

Just a question.

Are the below codes needed here?

Expect(job.Spec.Parallelism).Should(Equal(pointer.Int32Ptr(1)))
Expect(job.Spec.Completions).Should(Equal(pointer.Int32Ptr(1)))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the code confirms that the results of getGatlingRunnerJobParallelism are correct, we consider it unnecessary in the added test code. Of course, it can be added.

@kane8n kane8n requested a review from gold-kou March 21, 2024 11:31
Copy link
Contributor

@gold-kou gold-kou left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@sejima1105 sejima1105 left a comment

Choose a reason for hiding this comment

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

I have checked that the sample scenario works according to the steps outlined below.

This is evidence.

Defaulted container "gatling-runner" out of: gatling-runner, gatling-result-transferer, gatling-waiter (init)
Wait until 2024-03-26 01:35:28
GATLING_HOME is set to /opt/gatling
01:35:33.930 [WARN ] i.g.c.ZincCompiler$ - -target is deprecated: Use -release instead to compile against the correct platform API.
01:35:39.234 [WARN ] i.g.c.ZincCompiler$ - one warning found
Mar 26, 2024 1:35:41 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Gatling 3.10.5 is available! (you're using 3.9.5)
Simulation PersistentVolumeSampleSimulation started...
User 1 is buying goods 1 hoge
myresource: a
User 2 is buying goods 2 fuga
myresource: b
User 3 is buying goods 3 sample
myresource: c
User 4 is buying goods 4 test
myresource: a
User 5 is buying goods 5 goods
myresource: b
User 1 is buying goods 1 hoge
myresource: c
User 2 is buying goods 2 fuga
myresource: a
User 3 is buying goods 3 sample
myresource: b
User 4 is buying goods 4 test
myresource: c
User 5 is buying goods 5 goods
myresource: a
User 1 is buying goods 1 hoge
myresource: b

================================================================================
2024-03-26 01:35:49                                           5s elapsed
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=0      KO=0     )


---- Scenario Name -------------------------------------------------------------
[#################################--------                                 ] 45%
          waiting: 9      / active: 2      / done: 9     
================================================================================

User 2 is buying goods 2 fuga
myresource: c
User 3 is buying goods 3 sample
myresource: a
User 4 is buying goods 4 test
myresource: b
User 5 is buying goods 5 goods
myresource: c
User 1 is buying goods 1 hoge
myresource: a
User 2 is buying goods 2 fuga
myresource: b
User 3 is buying goods 3 sample
myresource: c
User 4 is buying goods 4 test
myresource: a
User 5 is buying goods 5 goods
myresource: b

================================================================================
2024-03-26 01:35:54                                          10s elapsed
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=0      KO=0     )


---- Scenario Name -------------------------------------------------------------
[######################################################################----] 95%
          waiting: 0      / active: 1      / done: 19    
================================================================================


================================================================================
2024-03-26 01:35:54                                          10s elapsed
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=0      KO=0     )


---- Scenario Name -------------------------------------------------------------
[##########################################################################]100%
          waiting: 0      / active: 0      / done: 20    
================================================================================

Simulation PersistentVolumeSampleSimulation completed in 10 seconds

@kane8n kane8n merged commit 8ce9dd1 into main Mar 28, 2024
3 checks passed
@kane8n kane8n deleted the add-pv-support branch March 28, 2024 02:02
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