Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Allure reporting from MFTF #69

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* Added `laravel` environment type to support local development of Laravel based applications (issue [#60](https://github.com/davidalger/warden/issues/60))
* Updated `env-init` command to include default values for available variables in the project's `.env` making customization a bit easier (issue [#32](https://github.com/davidalger/warden/issues/32))
* Updated default Elasticsearch version for `magento2` environments from 5.4 to 6.8 (issue [#66](https://github.com/davidalger/warden/issues/66))
* Updated Selenium setup for MFTF to use hub and headless nodes by default (issue [#67](https://github.com/davidalger/warden/issues/67); [#68](https://github.com/davidalger/warden/pull/68) by [lbajsarowicz](https://github.com/lbajsarowicz))
* Added Allure reporting support to Selenium setup for MFTF ([#69](https://github.com/davidalger/warden/pull/69) by [lbajsarowicz](https://github.com/lbajsarowicz))

**Bug fixes:**
* Fixed broken incorrect Blackfire environment template name for magento1 env type (issue [#48](https://github.com/davidalger/warden/issues/48))
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ All contributions to the Warden project are welcome: use-cases, documentation, c

Please note that by submitting a pull request or otherwise contributing to the Warden project, you warrant that each of your contributions is an original work and that you have full authority to grant rights to said contribution and by so doing you grant the owners of the Warden project, and those who receive the contribution directly or indirectly, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license to make, have made, use, offer to sell, sell and import or otherwise dispose of the contributions alone or with the Warden project in it's entirety.

### Allure reports

To access Allure reports generated (automatically updated each 60 seconds), you need to open in your browser:

* https://allure.exampleproject.test/

## License

This work is licensed under the MIT license. See [LICENSE](https://github.com/davidalger/warden/blob/develop/LICENSE) file for details.
Expand Down
2 changes: 2 additions & 0 deletions commands/env-init.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ if [[ "${WARDEN_ENV_TYPE}" == "magento1" ]]; then
REDIS_VERSION=5.0

WARDEN_SELENIUM=0
WARDEN_SELENIUM_DEBUG=0
WARDEN_BLACKFIRE=0

BLACKFIRE_CLIENT_ID="<client_id>"
Expand All @@ -56,6 +57,7 @@ if [[ "${WARDEN_ENV_TYPE}" == "magento2" ]]; then
VARNISH_VERSION=4.1

WARDEN_SELENIUM=0
WARDEN_SELENIUM_DEBUG=0
WARDEN_BLACKFIRE=0
WARDEN_SPLIT_SALES=0
WARDEN_SPLIT_CHECKOUT=0
Expand Down
6 changes: 6 additions & 0 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ if [[ ${WARDEN_SELENIUM} -eq 1 && -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TY
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.selenium.base.yml")
fi

if [[ ${WARDEN_SELENIUM_DEBUG} -eq 1 ]]; then
export WARDEN_SELENIUM_DEBUG="-debug"
else
export WARDEN_SELENIUM_DEBUG=
fi

## lookup internal (warden docker network) IP address of traefik container (do not fail if traefik is stopped)
export TRAEFIK_ADDRESS="$(docker container inspect traefik \
--format '{{.NetworkSettings.Networks.warden.IPAddress}}' 2>/dev/null || true)"
Expand Down
18 changes: 17 additions & 1 deletion docs/configuration/mftf.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ WARDEN_SELENIUM=1
After generating MFTF configuration files (`dev/tests/acceptance/.env` generated by `vendor/bin/mftf setup:env` command), you need to provide selenium hostname:

```
SELENIUM_HOST=selenium
SELENIUM_HOST=selenium-hub
BROWSER=chrome
```

### Debugging MFTF Tests

By default Warden uses headless Chrome browser. If you want to preview the tests - you need to extend `.env` file and update environment containers (`warden env up -d`)

```
WARDEN_SELENIUM_DEBUG=1
```

**Default password for VNC session is `secret`**

To preview the process of testing, you need any **VLC** client that provides **SSH Tunnel** support (eg. [Remmina](https://remmina.org/how-to-install-remmina/)). To preview the process of testing, you need to use `tunnel.warden.test:2222` (login: `user`):

### Remote Desktop Viewer
Expand All @@ -24,3 +34,9 @@ To preview the process of testing, you need any **VLC** client that provides **S
### Remmina

![Remmina Configuration](screenshots/remmina-ssh-tunnel.png)

### Allure reports

To access Allure reports generated (automatically updated each 60 seconds), you need to open in your browser:

* https://allure.exampleproject.test/
40 changes: 37 additions & 3 deletions environments/magento2.selenium.base.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
version: "3.5"
services:
selenium:
hostname: selenium
image: selenium/standalone-chrome-debug:3.8.1
selenium-hub:
container_name: ${WARDEN_ENV_NAME}_selenium-hub
hostname: selenium-hub
image: selenium/hub:3.8.1
networks:
- warden
- default
selenium-chrome:
hostname: ${WARDEN_ENV_NAME}_selenium-chrome
image: selenium/node-chrome${WARDEN_SELENIUM_DEBUG:-}:3.8.1
extra_hosts:
- ${TRAEFIK_SUBDOMAIN:-app}.${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0}
depends_on:
- selenium-hub
environment:
- HUB_HOST=selenium-hub
- HUB_PORT=4444
- START_XVFB=false
networks:
- warden
- default

allure:
hostname: "${WARDEN_ENV_NAME}-allure"
image: frankescobar/allure-docker-service
labels:
- traefik.enable=true
- traefik.http.routers.${WARDEN_ENV_NAME}-allure.tls=true
- traefik.http.routers.${WARDEN_ENV_NAME}-allure.rule=Host(`allure.${TRAEFIK_DOMAIN}`)
- traefik.http.services.${WARDEN_ENV_NAME}-allure.loadbalancer.server.port=4040
# TODO; configure the Allure API; these rules result in allure sub-domain no longer routing
# - traefik.http.routers.${WARDEN_ENV_NAME}-allure-api.tls=true
# - traefik.http.routers.${WARDEN_ENV_NAME}-allure-api.rule=Host(`allure-api.${TRAEFIK_DOMAIN}`)
# - traefik.http.services.${WARDEN_ENV_NAME}-allure-api.loadbalancer.server.port=5050
volumes:
- .${WARDEN_WEB_ROOT:-}/dev/tests/acceptance/tests/_output/allure-results:/app/allure-results
environment:
CHECK_RESULTS_EVERY_SECONDS: 60
KEEP_HISTORY: "TRUE"
networks:
- warden
- default