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

minor: Add inital browser tests #161

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
minor: Add inital browser tests
Signed-off-by: Vipul Gupta (@vipulgupta2048) <[email protected]>
  • Loading branch information
vipulgupta2048 committed Apr 12, 2024

Verified

This commit was signed with the committer’s verified signature.
Garfield550 Garfield Lee
commit f50f18ac2f56241aa17d7b76a777e8d3a9c61785
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)

sut:
build: sut
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
@@ -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)

sut:
build: sut
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