Skip to content

Commit

Permalink
Exposed Selenium VNC to host.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Aug 7, 2024
1 parent fb41904 commit 3c060f3
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ commands:
COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-${PWD##*/}} \
DREVOPS_HOST_DB_PORT=$(docker compose port mariadb 3306 2>/dev/null | cut -d : -f 2) \
DREVOPS_HOST_SOLR_PORT=$(docker compose port solr 8983 2>/dev/null | cut -d : -f 2) \
DREVOPS_HOST_SELENIUM_VNC_PORT=$(docker compose port chrome 7900 2>/dev/null | cut -d : -f 2) \
DREVOPS_HOST_HAS_SEQUELACE=$(uname -a | grep -i -q darwin && mdfind -name 'Sequel Ace' 2>/dev/null | grep -q "Ace" && echo 1 || true) \
ahoy cli ./scripts/drevops/info.sh "$@"
Expand Down
1 change: 1 addition & 0 deletions .scaffold/tests/bats/_helper.workflow.bash
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ assert_ahoy_info() {
assert_output_not_contains "DB-in-image : ${db_image}"
fi
assert_output_contains "Solr URL on host :"
assert_output_contains "Selenium VNC URL on host :"
assert_output_contains "Mailhog URL : http://mailhog.docker.amazee.io/"
assert_output_contains "Xdebug : Disabled ('ahoy debug' to enable)"
assert_output_not_contains "Containers are not running."
Expand Down
7 changes: 7 additions & 0 deletions .scaffold/tests/bats/fixtures/docker-compose.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
"networks": {
"default": null
},
"ports": [
{
"mode": "ingress",
"protocol": "tcp",
"target": 7900
}
],
"shm_size": "1073741824",
"volumes": [
{
Expand Down
7 changes: 7 additions & 0 deletions .scaffold/tests/bats/fixtures/docker-compose.env_local.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
"networks": {
"default": null
},
"ports": [
{
"mode": "ingress",
"protocol": "tcp",
"target": 7900
}
],
"shm_size": "1073741824",
"volumes": [
{
Expand Down
7 changes: 7 additions & 0 deletions .scaffold/tests/bats/fixtures/docker-compose.env_mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
"networks": {
"default": null
},
"ports": [
{
"mode": "ingress",
"protocol": "tcp",
"target": 7900
}
],
"shm_size": "1073741824",
"volumes": [
{
Expand Down
7 changes: 7 additions & 0 deletions .scaffold/tests/bats/fixtures/docker-compose.noenv.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
"networks": {
"default": null
},
"ports": [
{
"mode": "ingress",
"protocol": "tcp",
"target": 7900
}
],
"shm_size": "1073741824",
"volumes": [
{
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ services:
# Chrome container, used for browser testing.
chrome:
image: selenium/standalone-chromium:126.0
ports:
- "7900" # Find port on host with `docker-compose port chrome 7900`.
shm_size: '1gb' # Increase '/dev/shm' partition size to avoid browser crashing.
<<: *default-volumes # Use default volumes to provide access to test fixtures.
environment:
Expand Down
3 changes: 3 additions & 0 deletions scripts/drevops/info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ fi
if [ -n "${DREVOPS_HOST_SOLR_PORT:-}" ]; then
note "Solr URL on host : http://127.0.0.1:${DREVOPS_HOST_SOLR_PORT}"
fi
if [ -n "${DREVOPS_HOST_SELENIUM_VNC_PORT:-}" ]; then
note "Selenium VNC URL on host : http://localhost:${DREVOPS_HOST_SELENIUM_VNC_PORT}/?autoconnect=1&password=secret"

Check warning on line 48 in scripts/drevops/info.sh

View check run for this annotation

Codecov / codecov/patch

scripts/drevops/info.sh#L47-L48

Added lines #L47 - L48 were not covered by tests
fi
note "Mailhog URL : http://mailhog.docker.amazee.io/"
note "Xdebug : $(php -v | grep -q Xdebug && echo "Enabled ('ahoy up cli' to disable)" || echo "Disabled ('ahoy debug' to enable)")"
if [ "${DREVOPS_SHOW_LOGIN}" = "1" ] || [ -n "${1:-}" ]; then
Expand Down

1 comment on commit 3c060f3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.