28 Commits

Author SHA1 Message Date
Marco Miller
8f9b897594 e2e-tests: Enable postfix operators with compiler
Before this change, the scala compiler issued warnings such as the one
below, upon using the usual 'sbt compile' command.

  "(...) postfix operator second should be enabled
  [warn] by making the implicit value scala.language.postfixOps visible.
  [warn] This can be achieved by adding the import clause 'import scala.language.postfixOps'
  [warn] or by setting the compiler option -language:postfixOps."

Set the latter option in build.sbt to remove these warnings. This is
less invasive than adding the aforementioned import clause in each file.

Bug: Issue 12288
Change-Id: If52dcddbcc63579602c788455a95c5e7d9009ee2
2020-03-27 16:43:42 -04:00
Marco Miller
afa08d72a4 e2e-tests: Update Dockerfile gatling_git_version to 1.0.10
Which is the currently latest tag available from the gatling-git
extension.

Change-Id: I132398c18dd4cec3052c4e88ec11f170a192f0ca
2020-03-27 15:29:27 -04:00
Marco Miller
f8e08896e8 e2e-tests: Align gatling version with gatling-git
Align the gatling version used by the framework with the one used in
the gatling-git extension dependency.

This happens to fix the below issue, hence the reporting features.

Bug: Issue 12279
Change-Id: I63a8642ec71caaf2af5bcb12d54b94ff89e21bee
2020-03-27 15:28:03 -04:00
Marco Miller
edb22c0e14 e2e-tests: Introduce reused gatling version constant
Change-Id: I5e95b7938c4527e506a9267d8f48c776d1ab3502
2020-03-27 14:22:25 -04:00
Marco Miller
5b8d6d95b0 e2e-tests: Rename the now reused json filename constant
As that constant is now reused by both core and non-core (added in,
plugin) scenarios.

Change-Id: I91dcd2383a0780f81e741a4411eb21ecce6df576
2020-03-20 12:04:08 -04:00
Marco Miller
28c26cddd7 e2e-tests: Move core json files into scala package
Make the core resources data file structure consistent with the one used
to add non-core scenario files in.

Modify the documentation accordingly.

Change-Id: Ic352488a81cc43211fa38f0f2454b4fa944e9da6
2020-03-19 17:03:05 -04:00
Marco Miller
61ccca5abd e2e-tests: Support adding/running non-core scenarios
Document how to locally add non-core scenarios, for example from Gerrit
plugins, to then run them like regular core scenarios.

Include the companion .gitignore files, meant for the involved
destination folders.

Make the test data feeders private to scenarios now, while still reusing
the standard resource paths. This is to support non-core scenarios,
which require their resource path to slightly differ from core's. This
is so that non-core scenario resource files can be git-ignored when
added in, as per this change. Doing so also paves the way for more
structured resource data files based on scala package.

Change-Id: I499f9ed4765f64cf757aa244e427d7116c80d321
2020-03-19 15:31:17 -04:00
Marco Miller
f5eb7e4ed8 e2e-tests: Add create/delete project to CloneUsingBothProtocols
Add the CreateProject and DeleteProject scenarios and have the
CloneUsingBothProtocols scenario compose them. Make that scenario and
potential similar ones no longer require project creation outside of
them. Delete the project created by that scenario once done with it.

Clarify how to set the necessary http credentials in the documentation.

Refactor the GitSimulation class to fit with the hereby introduced
GerritSimulation one. The latter is meant to cover all things Gerrit,
including the added http support, while the former now only adds the git
specific harness to that.

Adapt ReplayRecordsFromFeeder accordingly, without adding create/delete
project support to that scenario yet. This can be done through another
change once needed.

Change-Id: Ifa72b7657c709266aca05cedb1e38d5e7fe4cd81
2020-03-19 14:24:46 -04:00
Marco Miller
68b42d90c9 e2e-tests: Collapse the load-tests directory level
Move the contents of the former load-tests directory to the root of this
structure. Before this change, that directory was the only file set
present in this e2e-tests root structure.

This removal also paves the way for potential non-load e2e tests, such
as functional feature ones. Gerrit already has unit and acceptance or
(partial) integration tests for its functionality. However organizations
still need to internally develop and maintain -thus duplicate- full e2e
integration tests. E.g., to smoke-test new release deployment acts for
either development, staging or production purposes.

This change then also proposes to consider reusing this Gatling
framework (DSL, protocols) for e2e feature integration tests, alongside
the emerging load ones -for Gerrit.

Change-Id: Idffa7f43b546d6bfdc5d7b170d8ddc6c51b095c3
2020-03-12 14:50:47 -04:00
Marco Miller
51b9b7da6e e2e-tests: Make scenarios extend new GitSimulation
Remove code duplication between the two scenario classes that way.

Foster future framework reusability through such initial reuse.

Bug: Issue 12281
Change-Id: I1e474901b2acc12554c0bb202456183a7a7a5e7e
2020-02-05 14:55:52 -05:00
Marco Miller
687632f2e8 CloneUsingBothProtocols: Align closing parenthesis
With the properly formatted way already used in ReplayRecordsFromFeeder.

Change-Id: Ibca779b1c2c3f4fafb22811125db003a56d6632f
2020-02-03 19:33:51 -05:00
Marco Miller
561560a891 ReplayRecordsFromFeeder: Refactor the after method
While aligning it with CloneUsingBothProtocols, i.e.:

- Extract the duplicated path into a reused local value.
- Move the Thread.sleep out of the try block.
- Remove the comment as it will come back in case of failure.

Next refactoring step(s) then: to extract duplication from these two
sibling scenario classes. Likely by means of introducing a common parent
class, as an intermediary between these two and their Simulation parent.
This is so the framework becomes more and more reusable and extensible.

Change-Id: I20eab87b4b533c356b1831fa346a1df4fce14729
2020-02-03 19:33:39 -05:00
Marco Miller
b416ab0db5 ReplayRecordsFromFeeder: Align scenario building
With the sibling CloneUsingBothProtocols class. Rename the related value
members accordingly. Replace the hardcoded scenario name with the
previously generalized member value; reuse it further.

Rename the related protocol value member while being at it. Move these
renamed value members so they appear as in CloneUsingBothProtocols.

Change-Id: Icd9b53a2326488eb3f76a7739e995f398e4937a9
2020-02-03 18:49:40 -05:00
Marco Miller
f979df0d3e ReplayRecordsFromFeeder: Extract request to value
Move the related protocol value member closer to it.

Change-Id: I25d752b6e865f0d76c97a098559436b18bfbf87c
2020-02-03 18:29:26 -05:00
Marco Miller
e19db8fb71 ReplayRecordsFromFeeder: Un-hardcode json filename
Make all of these members private as they should.

Change-Id: Ie8d514e1184b5f7803ae202e49a87e590d263c0e
2020-02-03 18:11:12 -05:00
Marco Miller
706d1b40f4 ReplayRecordsFromFeeder: Group implicit val at top
Change-Id: Ia8272d8b28b7ef234703cb42d33a576ac201fdae
2020-02-03 17:53:36 -05:00
Marco Miller
c2cb2704cd ReplayRecordsFromFeeder: Fix braces/parentheses warnings
This change lends no more warnings in IntelliJ for that class file.

Change-Id: I1433510e5e3f1d4f1a134a5324377392be1dd842
2020-02-03 17:45:36 -05:00
Marco Miller
edd923efa5 ReplayRecordsFromFeeder: Add type to public member
Fix the required Scala type annotation warnings in IntelliJ.

Change-Id: I26a1bf9dbe88cc55957718115fae830a8e53178b
2020-02-03 17:44:46 -05:00
Marco Miller
6531b6d8ce e2e-tests: Rename ReplayRecordsFromFeeder scenario
Remove the Scenario suffix from the class name, as that class is already
in the scenarios package; redundant otherwise. Align the file name with
the name of this class.

Change-Id: Ieab4b0cc6c89017e449b1520a5f7d4c234da50eb
2020-02-03 17:33:00 -05:00
Marco Miller
2b9650d205 e2e-tests: Reformat ReplayRecordsFromFeeder.scala
Based on the recently documented IntelliJ development setup Ib1ca9bc7.

Change-Id: I0260158893441a801e05d1c9f48c2622fa9439e6
2020-02-03 16:50:50 -05:00
Marco Miller
67cef4c769 e2e-tests: Upgrade sbt to 1.3.7
Change-Id: I367097eba455fb2b86597d7dde640b0e8ce645d8
2020-02-03 16:13:53 -05:00
Marco Miller
3f46efd565 e2e-tests: Introduce example to test local setups
Add the CloneUsingBothProtocols scenario class with its json file
companion. Propose a reusable way to code such classes, at least
initially, through that example class and json. Keep the corresponding
refactoring of their sibling ReplayRecordsFromFeederScenario files for
follow-up changes.

Use that simple and no-load CloneUsingBothProtocols scenario in the
documentation. Foster using that one instead to validate local setups.
As one's local setup gets tested that way, foster developing more
scenarios.

Change-Id: I39fae723a81633a49327e509a99269ba028dcbdf
2020-02-02 17:48:19 -05:00
Marco Miller
4aaa88829a e2e-tests: Foster IntelliJ for Scala and build.sbt
As that plugin ([1]) is the mainstream one for sbt in IntelliJ IDEA.

Recommend the latter IDE use for this Scala project. Reformat the
build.sbt file accordingly, to start with. IntelliJ so far has been the
most stable and reproducible development environment for Scala with sbt.

[1] https://plugins.jetbrains.com/plugin/1347-scala

Change-Id: Ib1ca9bc7cac4dca5b7da114ea3f3068a522bccd6
2020-02-02 17:48:19 -05:00
Marco Miller
f9ec11b626 e2e-tests: Sort and update some .gitignore entries
- Add a / prefix for every root directory entry.
- Regroup related entries closer together.
- Remove entries covered by more general ones.
- Make the scala/sbt comment style consistent.

Change-Id: I130ba17e401acc47a2ecb95a2c79bfcb06c27779
2020-02-02 17:48:19 -05:00
Marco Miller
51820c7776 e2e-tests: Add support for log level configuration
Document how to set log levels for sbt commands.

Add a logback.xml configuration file that sets Gatling's own log level.
Mention that file in the documentation, too.

Change-Id: I9b7726d776dd153f3717cb9bf206aa99eb20b6f1
2020-01-30 18:17:53 -05:00
Marco Miller
75a604684a e2e-tests: Move docker doc to Documentation page
To keep all e2e tests documentation and instructions in one go-to place.

Change-Id: Ie5fc8af928a8ce422c6bd2a11f8329626af087a2
2020-01-30 12:32:30 -05:00
Fabio Ponciroli
cf4985ac38 Dockerise Gatling tests
Dockerising the tests will help when running them from the CI.

Feature: Issue 11908
Change-Id: I15432b2246a2e6eda393fe885931488662d29f3e
2020-01-30 11:00:41 -05:00
Fabio Ponciroli
386aebbe51 E2E load tests example scenarios
Introduce examples of scenarios to show how to load test Gerrit
using Gatling.

This initial examples only include tests over the git protocol, however
it is possible to expand the scenarios to mix different protocols (Git, SSH, Http).

Feature: Issue 10900
Change-Id: I00927b3b83f45ca852305780f5e67a4272d1ab22
2019-09-10 16:19:10 +00:00