-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from maerteijn/nightmarejs
Added functional and unit tests
- Loading branch information
Showing
19 changed files
with
1,860 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- "node" | ||
|
||
services: | ||
- docker | ||
|
||
# so the functional tests will work | ||
addons: | ||
apt: | ||
packages: | ||
- xvfb | ||
install: | ||
- export DISPLAY=':99.0' | ||
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | ||
|
||
before_script: | ||
- cd $TRAVIS_BUILD_DIR | ||
|
||
script: | ||
- ./runtests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Versions | ||
-------- | ||
These docker images are build with Ubuntu 18.04 (bionic) and Debian 9 (stretch). They use the following repositories to install saltstack: | ||
- https://repo.saltstack.com/apt/debian/9/amd64/latest | ||
- http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest | ||
|
||
Version of all salt packages installed: *2018.3.2+ds-1* | ||
|
||
Docker images | ||
------------- | ||
Commands used to build these docker images:: | ||
|
||
docker build -f dockerfiles/dockerfile-saltmaster -t maerteijn/saltgui-saltmaster . | ||
docker build -f dockerfiles/dockerfile-saltminion-debian -t maerteijn/saltgui-saltminion-debian . | ||
docker build -f dockerfiles/dockerfile-saltminion-ubuntu -t maerteijn/saltgui-saltminion-ubuntu . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
FROM ubuntu | ||
FROM ubuntu:18.04 | ||
MAINTAINER Martijn Jacobs <martijn@devopsconsulting.nl> | ||
|
||
ENV REFRESHED_ON "7 Mar 2018" | ||
ENV REFRESHED_ON "24 Jul 2018" | ||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# some handy stuff to have and install gnupg2 | ||
RUN apt-get update && apt-get install curl --yes && apt-get install iproute2 --yes && apt-get install gnupg2 --yes | ||
|
||
# add saltstack key | ||
RUN curl --fail --silent --show-error --location https://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add - | ||
RUN echo 'deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest xenial main' > /etc/apt/sources.list.d/saltstack.list | ||
# add saltstack key and install dependencies | ||
RUN apt-get update && apt-get install curl gnupg2 net-tools --yes | ||
RUN curl --fail --silent --show-error --location https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add - | ||
RUN echo 'deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main' > /etc/apt/sources.list.d/saltstack.list | ||
|
||
# install salt-minion | ||
RUN apt-get update && apt-get install salt-minion --yes | ||
|
||
# copy the minion configuration | ||
ADD ./conf/minion /etc/salt/minion | ||
|
||
# show which versions are installed | ||
RUN dpkg -l | grep salt\- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
{ | ||
"name": "saltgui-linter", | ||
"description": "Simple check for JSHint (Code Linting)", | ||
"name": "saltgui-test", | ||
"description": "Code linting and testing package for SaltGUI", | ||
"author": "Martijn Jacobs", | ||
"version": "0.0.1", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"jshint": "^2.9.5" | ||
"chai": "^4.1.2", | ||
"jshint": "^2.9.5", | ||
"mocha": "^5.2.0", | ||
"nightmare": "^3.0.1" | ||
}, | ||
"jshintConfig": { | ||
"esversion": 6 | ||
}, | ||
"scripts": { | ||
"test": "jshint saltgui/" | ||
"lint": "jshint saltgui/ tests/", | ||
"wait-for-docker": "node tests/helpers/wait-for-docker.js", | ||
"test": "mocha --trace-warnings --reporter spec tests/unit/ tests/functional/" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# always cleanup the docker images when something goes wrong | ||
function cleanupdocker { | ||
docker-compose -f docker/docker-compose.yml rm -f -s | ||
} | ||
trap cleanupdocker EXIT | ||
|
||
set -e | ||
# add testing packages | ||
yarn | ||
|
||
# first see if we write es6 compatible js | ||
yarn lint | ||
|
||
# start a salt master, two salt minions and saltgui to run tests on | ||
docker-compose -f docker/docker-compose.yml up -d | ||
|
||
# wait until all are up | ||
yarn wait-for-docker | ||
|
||
# run the unittests/nightmare.js functional tests | ||
yarn test | ||
|
||
set +e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.