Skip to content

Commit

Permalink
minor: Add inital browser tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vipul Gupta (@vipulgupta2048) <[email protected]>
  • Loading branch information
vipulgupta2048 committed Nov 23, 2023
1 parent c8a7cfe commit f374521
Show file tree
Hide file tree
Showing 8 changed files with 4,416 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules
23 changes: 23 additions & 0 deletions docker-compose.sut.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# TEST FLEET - Docker Compose only for testing
# You can test environments and stuff

version: '2'

volumes:
settings: # Only required if using PERSISTENT flag (see below)

services:

browser:
build: .
privileged: true # required for UDEV to find plugged in peripherals such as a USB mouse
network_mode: host
volumes:
- 'settings:/data' # Only required if using PERSISTENT flag (see below)

tests:
build: tests
network_mode: host
restart: no
depends_on:
- browser
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ services:
privileged: true # required for UDEV to find plugged in peripherals such as a USB mouse
network_mode: host
volumes:
- 'settings:/data' # Only required if using PERSISTENT flag (see below)
- 'settings:/data' # Only required if using PERSISTENT flag (see below)

tests:
build: tests
network_mode: host
restart: no
depends_on:
- browser
17 changes: 17 additions & 0 deletions tests/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG NODEJS_VERSION="16.19.1"

FROM balenalib/%%BALENA_MACHINE_NAME%%-debian-node:${NODEJS_VERSION}-bullseye-run

WORKDIR /usr/tests/

COPY server server
COPY package* ./
RUN npm ci && install_packages jq

# COPY testImage.png testImage.png

# Entrypoint
COPY entry.sh .
CMD [ "/bin/bash", "/usr/tests/entry.sh" ]

# ENTRYPOINT ["tail", "-f", "/dev/null"]
9 changes: 9 additions & 0 deletions tests/entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

echo "### TEST START $TEST_ID ###"

npm run test

exit=$(echo $?)

echo "### TEST RESULT $TEST_ID $exit ###"
Loading

0 comments on commit f374521

Please sign in to comment.