-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
68 lines (65 loc) · 2.71 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
stages:
- test
test-job-edge:
stage: test
only:
- master
image: docker:latest
services:
- docker:dind
script:
- docker network create testnetwork
- docker run --name "selenium-edge" -d --network=testnetwork -p 4444:4444 --shm-size="2g" selenium/standalone-edge:114.0
- HOST=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' selenium-edge`
- docker run --name "maven" --network=testnetwork -v "$(pwd)":/app -w /app maven:latest mvn test -Dheadless=true -Dremote=true -Dhost=$HOST
- docker cp maven:/app/target/allure-results/ .
- docker stop selenium-edge && docker rm selenium-edge
- docker stop maven && docker rm maven
- tar -czf test-result.tar.gz target/allure-results/
artifacts:
paths:
- "test-result.tar.gz"
when: always
expire_in: "7 days"
test-job-chrome:
stage: test
only:
- master
image: docker:latest
services:
- docker:dind
script:
- docker network create testnetwork
- docker run --name "selenium-chrome" -d --network=testnetwork -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:116.0
- HOST=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' selenium-chrome`
- docker run --name "maven" --network=testnetwork -v "$(pwd)":/app -w /app maven:latest mvn test -Dbrowser=chrome -Dheadless=true -Dremote=true -Dhost=$HOST
- docker cp maven:/app/target/allure-results/ .
- docker stop selenium-chrome && docker rm selenium-chrome
- docker stop maven && docker rm maven
- tar -czf test-result.tar.gz target/allure-results/
artifacts:
paths:
- "test-result.tar.gz"
when: always
expire_in: "7 days"
test-job-firefox:
stage: test
only:
- master
image: docker:latest
services:
- docker:dind
script:
- docker network create testnetwork
- docker run --name "selenium-firefox" -d --network=testnetwork -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:117.0
- HOST=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' selenium-firefox`
- docker run --name "maven" --network=testnetwork -v "$(pwd)":/app -w /app maven:latest mvn test -Dbrowser=firefox -Dheadless=true -Dremote=true -Dhost=$HOST
- docker cp maven:/app/target/allure-results/ .
- docker stop selenium-firefox && docker rm selenium-firefox
- docker stop maven && docker rm maven
- tar -czf test-result.tar.gz target/allure-results/
artifacts:
paths:
- "test-result.tar.gz"
when: always
expire_in: "7 days"