Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.

Commit ab4f997

Browse files
authored
Fixes for 0.2.1 (#21)
* remove stale config example * update docker-compose to relect new configuration using flags * update readme to reflect execution mode changes and remove gitlab-ci badge which is not visible to everyone * documentation updates for running replicant * make explicit commment about runnning for test development
1 parent 5f7a116 commit ab4f997

File tree

3 files changed

+42
-66
lines changed

3 files changed

+42
-66
lines changed

README.md

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
[![Go Report Card](https://goreportcard.com/badge/github.com/Unbabel/replicant?style=flat-square)](https://goreportcard.com/report/github.com/Unbabel/replicant)
44
[![GoDoc](https://img.shields.io/badge/api-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/Unbabel/replicant)
55
[![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/unbabel/replicant?style=flat-square)](https://hub.docker.com/r/unbabel/replicant)
6-
[![pipeline status](https://gitlab.com/Unbabel/sre-team/replicant/badges/master/pipeline.svg)](https://gitlab.com/Unbabel/sre-team/replicant/-/commits/master)<br/>
7-
86

97
Replicant is a synthetic testing service named after the bioengineered androids from Blade Runner. (all synthetics came from Blade Runner :)
108

@@ -14,25 +12,48 @@ It allows web application testing using chromedp, and api application testing us
1412

1513
***Under heavy development and API changes are expected. Please file an issue if anything breaks.***
1614

17-
## Requirements
15+
## Runing replicant
16+
17+
The replicant binary packs all functionality needed to run the server, executor and run local execution of tests for development or CI/CD purposes.
18+
19+
### Locally for test development purposes
20+
21+
```bash
22+
/path/to/replicant run --file api-test.yaml
23+
```
24+
25+
If running locally from with the replicant binary a local chrome web browser with the development protocol can be specified:
26+
27+
```bash
28+
/path/to/replicant run --chrome-remote-url http://127.0.0.1:9222 --file web-test.yaml
29+
```
30+
31+
To have the local chrome browser started with the developer protocol enabled:
32+
33+
```bash
34+
/path/to/chrome --remote-debugging-port=9222
35+
```
36+
37+
### Configuration options
1838

19-
* Go 1.13
20-
* External URL for API tests that require webhook based callbacks
21-
* Chrome with remote debugging (CDP) either in headless mode or in foreground (useful for testing)
39+
Please see:
2240

23-
## Examples
41+
```bash
42+
/path/to/replicant --help
43+
```
2444

25-
## Running the replicant server locally with docker
45+
### Replicant server and executor locally with docker
2646

27-
Using [example config](https://github.com/Unbabel/replicant/blob/master/example-config.yaml) from the project root dir.
47+
The unbabel/replicant docker image packs everything needed to run and manage tests for both web apps and APIs.
48+
See the example `docker-compose.yaml` for more information.
2849

2950
```bash
3051
docker stack deploy -c $PWD/docker-compose.yaml replicant
3152
```
3253

33-
This will deploy the replicant server and 2 chrome-headless nodes for web tests, persisting data under /data.
54+
This will deploy the replicant server and 2 replicant executor nodes for web tests.
3455

35-
### Web application testing (local development)
56+
### Web application testing
3657

3758
Web application testing support is based on the FQL (Ferret Query Language), [documentation](https://github.com/MontFerret/ferret).
3859

@@ -98,21 +119,24 @@ script: |
98119
}
99120
```
100121

101-
### API testing (local development)
122+
### API testing
102123

103124
##### Using the javascript driver
104125
The following API is exposed by the javascript driver in order to perform HTTP calls and logging:
105126
* `replicant.Log(string)` log messages from the javascript test on the replicant server log.
106-
* `replicant.NewResponse()` create a new response object to be returned as a result of the test, which should be modified accordingly to reflect the test result. The response must be returned as a serialized JSON object by calling its bounded method `Response.JSON`, E.g. `return response.JSON()`.
107127

108-
Response type attributes:
128+
129+
* `replicant.NewResult()` create a new response object to be returned as a result of the test, which should be modified accordingly to reflect the test result. The response must be returned as a serialized JSON object by calling its bounded method `Response.JSON`, E.g. `return response.JSON()`.
130+
131+
Result type attributes:
109132
```js
110133
{
111134
Data: "",
112135
Message: "",
113136
Failed: false,
114137
}
115138
```
139+
116140
* `replicant.http.NewRequest()` creates a new HTTP request object for performing HTTP calls.
117141

118142
HttpRequest attributes:

docker-compose.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,15 @@ version: "3.7"
33
services:
44
server:
55
image: docker.io/unbabel/replicant:latest
6+
command: /app/replicant server --listen-address 0.0.0.0:8080 --executor-url http://executor:8080
67
ports:
78
- "8080:8080"
8-
volumes:
9-
- data:/data
10-
configs:
11-
- config.yaml
12-
command: /app/replicant -config /config.yaml
13-
cdp:
14-
image: docker.io/unbabel/replicant:replicant-cdp-latest
9+
executor:
10+
image: docker.io/unbabel/replicant:latest
11+
command: /app/replicant executor --listen-address 0.0.0.0:8080 --chrome-enable-local --server-url http://server:8080
1512
deploy:
1613
mode: replicated
1714
replicas: 2
1815
volumes:
1916
data: null
20-
configs:
21-
config.yaml:
22-
file: ./example-config.yaml
2317

example-config.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)