Skip to content

Commit cd09c03

Browse files
committed
Added junit log for phpunit
2 parents 451dbfc + 88b7e1c commit cd09c03

12 files changed

+184
-104
lines changed

.ci/jobs/defaults.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@
6969
publishers:
7070
- email:
7171
recipients: [email protected]
72-
# - junit:
73-
# results: "*-junit.xml"
74-
# allow-empty-results: true
72+
- junit:
73+
results: "tests/*-junit.xml"
74+
allow-empty-results: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- job:
3+
name: elastic+elasticsearch-php+7.7
4+
display-name: 'elastic / elasticsearch-php # 7.7'
5+
description: Testing the elasticsearch-php 7.7 branch.
6+
parameters:
7+
- string:
8+
name: branch_specifier
9+
default: refs/heads/7.7
10+
description: the Git branch specifier to build (<branchName>, <tagName>,
11+
<commitId>, etc.)
12+
triggers:
13+
- github
14+
- timed: '@daily'

.ci/jobs/elastic+elasticsearch-php+7.x.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
<commitId>, etc.)
1212
triggers:
1313
- github
14-
- timed: '@weekly'
14+
- timed: '@daily'

.ci/jobs/elastic+elasticsearch-php+pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
name: elastic+elasticsearch-php+pull-request
44
display-name: 'elastic / elasticsearch-php # pull-request'
55
description: Testing of elasticsearch-php pull requests.
6+
junit_results: "tests/*-junit.xml"
67
scm:
78
- git:
89
branches:
@@ -16,4 +17,3 @@
1617
github-hooks: true
1718
status-context: clients-ci
1819
cancel-builds-on-update: true
19-
publishers: []

.ci/run-repository.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ repo=$(realpath $(dirname $(realpath -s $0))/../)
3535
docker run \
3636
--network=${network_name} \
3737
--workdir="/usr/src/app" \
38+
--volume=${repo}/tests:/usr/src/app/tests \
3839
--env STACK_VERSION=${STACK_VERSION} \
3940
--env TEST_SUITE=${TEST_SUITE} \
4041
--env PHP_VERSION=${PHP_VERSION} \

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ util/cache/
3232

3333
# Code coverage
3434
build
35+
36+
# Junit test output
37+
tests/*-junit.xml

docs/crud.asciidoc

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
[[indexing_documents]]
2-
== Indexing Documents
2+
== Indexing documents
33

4-
IMPORTANT: Please note that mapping types will disappear from Elasticsearch, read more https://www.elastic.co/guide/en/elasticsearch/reference/7.x/removal-of-types.html[here]. If you migrated types from Elasticsearch 6 to 7, you can address these with the `type` param.
4+
IMPORTANT: Please note that mapping types will disappear from {es}, read more
5+
{ref-7x}/removal-of-types.html[here]. If you migrated types from {es} 6 to 7,
6+
you can address these with the `type` param.
7+
8+
When you add documents to {es}, you index JSON documents. This maps naturally to
9+
PHP associative arrays, since they can easily be encoded in JSON. Therefore, in
10+
Elasticsearch-PHP you create and pass associative arrays to the client for
11+
indexing. There are several methods of ingesting data into {es} which we cover
12+
here.
513

6-
When you add documents to Elasticsearch, you index JSON documents. This maps naturally to PHP associative arrays, since
7-
they can easily be encoded in JSON. Therefore, in Elasticsearch-PHP you create and pass associative arrays to the client
8-
for indexing. There are several methods of ingesting data into Elasticsearch, which we will cover here.
914

1015
=== Single document indexing
1116

12-
When indexing a document, you can either provide an ID or let elasticsearch generate one for you.
17+
When indexing a document, you can either provide an ID or let {es} generate one
18+
for you.
1319

1420
{zwsp} +
1521

@@ -40,7 +46,9 @@ $response = $client->index($params);
4046
----
4147
{zwsp} +
4248

43-
If you need to set other parameters, such as a `routing` value, you specify those in the array alongside the `index`, etc. For example, let's set the routing and timestamp of this new document:
49+
If you need to set other parameters, such as a `routing` value, you specify
50+
those in the array alongside the `index`, and others. For example, let's set the
51+
routing and timestamp of this new document:
4452

4553
.Additional parameters
4654
[source,php]
@@ -58,11 +66,14 @@ $response = $client->index($params);
5866
----
5967
{zwsp} +
6068

69+
6170
=== Bulk Indexing
6271

63-
Elasticsearch also supports bulk indexing of documents. The bulk API expects JSON action/metadata pairs, separated by
64-
newlines. When constructing your documents in PHP, the process is similar. You first create an action array object
65-
(e.g. `index` object), then you create a document body object. This process repeats for all your documents.
72+
{es} also supports bulk indexing of documents. The bulk API expects JSON
73+
action/metadata pairs, separated by newlines. When constructing your documents
74+
in PHP, the process is similar. You first create an action array object (for
75+
example, an `index` object), then you create a document body object. This
76+
process repeats for all your documents.
6677

6778
A simple example might look like this:
6879

@@ -85,9 +96,9 @@ for($i = 0; $i < 100; $i++) {
8596
$responses = $client->bulk($params);
8697
----
8798

88-
In practice, you'll likely have more documents than you want to send in a single bulk request. In that case, you need
89-
to batch up the requests and periodically send them:
90-
99+
In practice, you'll likely have more documents than you want to send in a single
100+
bulk request. In that case, you need to batch up the requests and periodically
101+
send them:
91102

92103
.Bulk indexing with batches
93104
[source,php]
@@ -126,11 +137,12 @@ if (!empty($params['body'])) {
126137
----
127138

128139
[[getting_documents]]
129-
== Getting Documents
140+
== Getting documents
130141

131-
Elasticsearch provides realtime GETs of documents. This means that as soon as the document has been indexed and your
132-
client receives an acknowledgement, you can immediately retrieve the document from any shard. Get operations are
133-
performed by requesting a document by it's full `index/type/id` path:
142+
{es} provides realtime GETs of documents. This means that as soon as the
143+
document is indexed and your client receives an acknowledgement, you can
144+
immediately retrieve the document from any shard. Get operations are performed
145+
by requesting a document by its full `index/type/id` path:
134146

135147
[source,php]
136148
----
@@ -145,15 +157,17 @@ $response = $client->get($params);
145157
{zwsp} +
146158

147159
[[updating_documents]]
148-
== Updating Documents
160+
== Updating documents
149161

150-
Updating a document allows you to either completely replace the contents of the existing document, or perform a partial
151-
update to just some fields (either changing an existing field, or adding new fields).
162+
Updating a document allows you to either completely replace the contents of the
163+
existing document, or perform a partial update to just some fields (either
164+
changing an existing field or adding new fields).
152165

153166
=== Partial document update
154167

155-
If you want to partially update a document (e.g. change an existing field, or add a new one) you can do so by specifying
156-
the `doc` in the `body` parameter. This will merge the fields in `doc` with the existing document
168+
If you want to partially update a document (for example, change an existing
169+
field or add a new one) you can do so by specifying the `doc` in the `body`
170+
parameter. This merges the fields in `doc` with the existing document.
157171

158172

159173
[source,php]
@@ -173,10 +187,12 @@ $response = $client->update($params);
173187
----
174188
{zwsp} +
175189

190+
176191
=== Scripted document update
177192

178-
Sometimes you need to perform a scripted update, such as incrementing a counter or appending a new value to an array.
179-
To perform a scripted update, you need to provide a script and (usually) a set of parameters:
193+
Sometimes you need to perform a scripted update, such as incrementing a counter
194+
or appending a new value to an array. To perform a scripted update, you need to
195+
provide a script and usually a set of parameters:
180196

181197
[source,php]
182198
----
@@ -195,10 +211,12 @@ $response = $client->update($params);
195211
----
196212
{zwsp} +
197213

214+
198215
=== Upserts
199216

200-
Upserts are "Update or Insert" operations. This means an upsert will attempt to run your update script, but if the document
201-
does not exist (or the field you are trying to update doesn't exist), default values will be inserted instead.
217+
Upserts are "Update or Insert" operations. This means an upsert attempts to run
218+
your update script, but if the document does not exist (or the field you are
219+
trying to update doesn't exist), default values are inserted instead.
202220

203221
[source,php]
204222
----
@@ -222,10 +240,12 @@ $response = $client->update($params);
222240
----
223241
{zwsp} +
224242

243+
225244
[[deleting_documents]]
226245
== Deleting documents
227246

228-
Finally, you can delete documents by specifying their full `/index/_doc_/id` path:
247+
Finally, you can delete documents by specifying their full `/index/_doc_/id`
248+
path:
229249

230250
[source,php]
231251
----

docs/namespaces.asciidoc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
== Namespaces
33

44
The client has a number of "namespaces", which generally expose administrative
5-
functionality. The namespaces correspond to the various administrative endpoints
6-
in Elasticsearch. This is a complete list of namespaces:
5+
functionality. The namespaces correspond to the various administrative endpoints
6+
in {es}. This is a complete list of namespaces:
77

88

99
[width="40%",options="header",frame="topbot"]
1010
|============================
11-
| Namespace | Functionality
11+
| Namespace | Functionality
1212
| `indices()` | Index-centric stats and info
1313
| `nodes()` | Node-centric stats and info
1414
| `cluster()` | Cluster-centric stats and info
1515
| `snapshot()` | Methods to snapshot/restore your cluster and indices
1616
| `cat()` | Access to the Cat API (which is generally used standalone from the command line
1717
|============================
1818

19-
Some methods are available in several different namespaces, which give you
20-
the same information but grouped into different contexts. To see how these
19+
Some methods are available in several different namespaces, which give you the
20+
same information but grouped into different contexts. To see how these
2121
namespaces work, let's look at the `_stats` output:
2222

2323

@@ -39,8 +39,8 @@ $response = $client->cluster()->stats();
3939
----
4040
{zwsp} +
4141

42-
As you can see, the same `stats()` call is made through three different
43-
namespaces. Sometimes the methods require parameters. These parameters work
42+
As you can see, the same `stats()` call is made through three different
43+
namespaces. Sometimes the methods require parameters. These parameters work
4444
just like any other method in the library.
4545

4646
For example, we can requests index stats about a specific index, or multiple
@@ -60,7 +60,7 @@ $response = $client->indices()->stats($params);
6060
----
6161
{zwsp} +
6262

63-
As another example, here is how you might add an alias to an existing index:
63+
The following example shows how you can add an alias to an existing index:
6464

6565
[source,php]
6666
----
@@ -77,6 +77,7 @@ $params['body'] = array(
7777
$client->indices()->updateAliases($params);
7878
----
7979

80-
Notice how both the `stats` calls and the updateAlias took a variety of parameters,
81-
each according to what the particular API requires. The `stats` API only requires
82-
an index name(s), while the `updateAlias` requires a body of actions.
80+
Notice how both the `stats` calls and the updateAlias took a variety of
81+
parameters, each according to what the particular API requires. The `stats` API
82+
only requires an index name(s), while the `updateAlias` requires a body of
83+
actions.

0 commit comments

Comments
 (0)