Merge branch 'stable-3.0' into stable-3.1
* stable-3.0:
Replace unused postgresql jar with manual site copy
Align postgresql version used with gerrit core one
Stop shipping core dependencies within plugin jar
Sort CONDUCTOR_DEPS and EXECUTOR_DEPS alphabetically
Adapt documentation version link in README for e2e
Add README introducing e2e plugin test scenarios
Change-Id: Ib88ac91a4dded59d7fefd971900c1bd6465ba146
diff --git a/BUILD b/BUILD
index 3ebfd66..66c91cf 100644
--- a/BUILD
+++ b/BUILD
@@ -7,26 +7,23 @@
"gerrit_plugin",
)
-CONDUCTOR_DEPS = [
- "@postgresql//jar",
+EXECUTOR_DEPS = [
+ "@aopalliance//jar",
"@dbcp//jar",
- "@pool//jar",
-]
-
-EXECUTOR_DEPS = CONDUCTOR_DEPS + [
- "@javaewah//jar",
"@guava//jar",
"@guava-failureaccess//jar",
"@guice//jar",
"@guice-assistedinject//jar",
+ "@javaewah//jar",
"@javax_inject//jar",
- "@aopalliance//jar",
- "@slf4j-api//jar",
- "@slf4j-ext//jar",
- "@log4j-slf4j-impl//jar",
"@log4j-api//jar",
"@log4j-core//jar",
+ "@log4j-slf4j-impl//jar",
+ "@pool//jar",
+ "@postgresql//jar",
"@retry//jar",
+ "@slf4j-api//jar",
+ "@slf4j-ext//jar",
"//lib:jgit",
]
@@ -48,7 +45,6 @@
["src/main/resources/**/*"],
exclude = ["src/main/resources/log4j2.xml"],
),
- deps = CONDUCTOR_DEPS,
)
java_library(
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
index 6a61adf..7312b0b 100644
--- a/external_plugin_deps.bzl
+++ b/external_plugin_deps.bzl
@@ -43,8 +43,8 @@
maven_jar(
name = "postgresql",
- artifact = "org.postgresql:postgresql:42.2.4",
- sha1 = "dff98730c28a4b3a3263f0cf4abb9a3392f815a7",
+ artifact = "org.postgresql:postgresql:42.2.5",
+ sha1 = "951b7eda125f3137538a94e2cbdcf744088ad4c2",
)
maven_jar(
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
index 3643444..24ec423 100644
--- a/src/main/resources/Documentation/build.md
+++ b/src/main/resources/Documentation/build.md
@@ -7,7 +7,7 @@
* In Gerrit tree.
Standalone build mode is recommended, as this mode doesn't require local Gerrit
-tree to exist.
+tree to exist. This plugin has a side component, gc-executor, to build as well.
Successfully running some of the tests requires Docker,
which are skipped if Docker is not available.
@@ -55,6 +55,7 @@
to generate the required files and then import the project.
+## Building gc-executor
To build the executor, issue the following command:
@@ -65,11 +66,21 @@
The output is created in:
```
- /bazel-bin/gc-executor_deploy.jar
+ bazel-bin/gc-executor_deploy.jar
```
This jar should be renamed to gc-executor.jar before deployment.
+Once the executor is built, the resulting postgresql jar file like below
+should be manually copied over to the gerrit site /lib folder; on macOS:
+
+```
+ bazel-out/darwin-fastbuild/bin/gc-executor.runfiles/gc_executor/external/postgresql/jar/postgresql-42.2.5.jar
+```
+
+That file has to be in accordance with potentially existing database driver
+files under site's /lib, for proper account_patch_reviews support.
+
## Build in Gerrit tree
Clone or link this plugin to the plugins directory of Gerrit's
diff --git a/src/test/README.md b/src/test/README.md
new file mode 100644
index 0000000..858ef4c
--- /dev/null
+++ b/src/test/README.md
@@ -0,0 +1,27 @@
+# About this directory structure
+
+```bash
+ ./resources/com
+ ./scala
+```
+
+To start using the files under these directories above, consider the
+[instructions](https://gerrit-documentation.storage.googleapis.com/Documentation/3.0.9/dev-e2e-tests.html)
+on how to use Gerrit core's Gatling framework. These are about running
+non-core test scenarios such as this plugin one below:
+
+```bash
+ sbt "gatling:testOnly com.ericsson.gerrit.plugins.gcconductor.scenarios.CreateChangesTriggeringGc"
+
+```
+
+This is a scenario that can serve as an example for how to start testing
+this plugin, along with its executor component. Both of these components
+should be locally installed along with default configuration. Plugin's
+gc-executor component is assumed to be running alongside Gerrit.
+
+Scenario scala source files and their companion json resource ones are
+stored under the usual src/test directories. That structure follows the
+scala package one from the scenario classes. The core framework expects
+such a directory structure for both the scala and resources (json data)
+files.