Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

Commit 0ffd114

Browse files
committed
Merge branch 'canary'
2 parents 1ca7b7f + 87b1161 commit 0ffd114

File tree

11 files changed

+191
-131
lines changed

11 files changed

+191
-131
lines changed

.ci/test/basic.bats

Lines changed: 0 additions & 76 deletions
This file was deleted.

.ci/test/expect/stats.exp

Lines changed: 0 additions & 5 deletions
This file was deleted.

.ci/tests/basic.bats

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
set -o allexport
2+
# SET TEST ENV
3+
TERMINUSDB_AUTOLOGIN=false
4+
TERMINUSDB_BATS_CONSOLE_REPO="${BATS_TEST_DIRNAME}/../build/terminusdb-console"
5+
TERMINUSDB_CONSOLE_BASE_URL=//127.0.0.1:53005
6+
TERMINUSDB_PORT=56363
7+
TERMINUSDB_CONTAINER="terminusdb-server-bats-test"
8+
TERMINUSDB_STORAGE=terminusdb-server-bats-test
9+
10+
# LOAD QUICKSTART ENV
11+
# shellcheck disable=SC1091
12+
# shellcheck source=$(pwd)/terminusdb-container
13+
source "$(pwd)/terminusdb-container" nop
14+
set +o allexport
15+
16+
PATH="${BATS_TEST_DIRNAME}/stubs:$PATH"
17+
18+
yes_container() {
19+
yes | container $@
20+
}
21+
22+
container() {
23+
"${BATS_TEST_DIRNAME}/../../terminusdb-container" "${@}"
24+
}
25+
26+
inspect() {
27+
[[ $($TERMINUSDB_QUICKSTART_DOCKER inspect -f '{{.State.Running}}' "${TERMINUSDB_QUICKSTART_CONTAINER}") == "true" ]]
28+
}
29+
30+
inspect_volume() {
31+
$TERMINUSDB_QUICKSTART_DOCKER volume inspect -f '{{.Name}}' "${TERMINUSDB_QUICKSTART_STORAGE}"
32+
}
33+
34+
@test "quickstart run" {
35+
run container run
36+
[[ "${status}" == 0 ]]
37+
run inspect
38+
[[ "${status}" == 0 ]]
39+
}
40+
41+
@test "docker volume exists" {
42+
run inspect_volume
43+
[[ "${status}" == 0 ]]
44+
}
45+
46+
@test "quickstart help" {
47+
run container help
48+
[[ "${status}" == 0 ]]
49+
}
50+
51+
@test "quickstart console" {
52+
run container console
53+
[[ "${status}" == 0 ]]
54+
[[ "${lines[0]}" == "python" ]]
55+
}
56+
57+
@test "quickstart attach" {
58+
run expect "${BATS_TEST_DIRNAME}/expect/attach.exp"
59+
[[ "${status}" == 0 ]]
60+
}
61+
62+
@test "terminusdb console build" {
63+
TERMINUSDB_QUICKSTART_BRANCH=$(git rev-parse --abbrev-ref HEAD)
64+
if [[ ! -d "${TERMINUSDB_BATS_CONSOLE_REPO}" ]]; then
65+
git clone https://github.com/terminusdb/terminusdb-console.git "${TERMINUSDB_BATS_CONSOLE_REPO}"
66+
else
67+
mkdir -p "${TERMINUSDB_BATS_CONSOLE_REPO}"
68+
fi
69+
cd "${TERMINUSDB_BATS_CONSOLE_REPO}"
70+
case "${TERMINUSDB_QUICKSTART_BRANCH}" in
71+
dev)
72+
TERMINUSDB_CONSOLE_BRANCH=dev
73+
;;
74+
canary)
75+
TERMINUSDB_CONSOLE_BRANCH=canary
76+
;;
77+
*)
78+
TERMINUSDB_CONSOLE_BRANCH=master
79+
esac
80+
git checkout "${TERMINUSDB_CONSOLE_BRANCH}"
81+
git pull
82+
npm install
83+
run npm run build
84+
[[ "${status}" == 0 ]]
85+
}
86+
87+
@test "terminusdb console tests" {
88+
cd "${TERMINUSDB_BATS_CONSOLE_REPO}"
89+
cd console/dist
90+
fuser -k 53005/tcp || true
91+
npx http-server -p 53005 &
92+
sleep 10
93+
cd "${TERMINUSDB_BATS_CONSOLE_REPO}"
94+
export CYPRESS_BASE_URL="${TERMINUSDB_QUICKSTART_CONSOLE}/"
95+
npx cypress run --reporter tap --spec 'cypress/integration/tests/login.spec.js' >&3
96+
fuser -k 53005/tcp || true
97+
}
98+
99+
@test "quickstart stop" {
100+
run container stop >&3
101+
[[ "${status}" == "0" ]]
102+
run inspect
103+
[[ "${status}" != "0" ]]
104+
}
105+
106+
@test "terminusdb server tests" {
107+
$TERMINUSDB_QUICKSTART_DOCKER run -it --rm -e TERMINUSDB_HTTPS_ENABLED=false "$TERMINUSDB_QUICKSTART_REPOSITORY:$TERMINUSDB_QUICKSTART_TAG" bash -c "./utils/db_init -s localhost -k root && swipl -g run_tests -g halt ./start.pl"
108+
}
109+
110+
@test "quickstart rm" {
111+
run yes_container rm >&3
112+
[[ "${status}" == 0 ]]
113+
run inspect_volume
114+
[[ "${status}" != 0 ]]
115+
}
File renamed without changes.
File renamed without changes.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
ENV
2+
_bats_log
3+
.ci/build
4+
package-lock.json

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ services:
1111

1212
script:
1313
- shellcheck ./terminusdb-container
14-
- bats .ci/test/basic.bats
15-
- ./terminusdb-container test
14+
- bats .ci/tests/basic.bats

ENV.example

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
# Local Directory to Mount inside Container
2929
#TERMINUSDB_LOCAL=/home/username/localfiles
3030

31+
# URL To TermiunusDB Console
32+
#TERMINUSDB_CONSOLE_BASE_URL=//127.0.0.1:3005
33+
3134
# Server
32-
#TERMINUSDB_SERVER=locahost
33-
#TERMINUSDB_SERVER_IP=127.0.0.1
34-
#TERMINUSDB_SERVER_PORT=6363
35-
#TERMINUSDB_PASS=root
3635
#TERMINUSDB_AUTOLOGIN=false
36+
#TERMINUSDB_PASS=root
37+
#TERMINUSDB_SERVER_IP=127.0.0.1
3738
#TERMINUSDB_CONSOLE=http://127.0.0.1/console
38-
#TERMINUSDB_CONSOLE_BASE_URL=//127.0.0.1:3005
3939

4040
# HTTPS
4141
#TERMINUSDB_HTTPS_ENABLED=true

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,28 @@ follow these steps:
206206
1. Copy `ENV.example` to `ENV`.
207207
2. Edit `ENV`: uncomment the lines you want to change and set the values.
208208

209-
## `ENV` Examples
209+
## ENV reference
210+
211+
| ENV name | Default value | Purpose |
212+
|-----------------------------|-----------------------------------------------------------------------------|---------------------------------------------------------------|
213+
| TERMINUSDB_DOCKER | sudo docker | Default docker command |
214+
| TERMINUSDB_CONTAINER | terminusdb-server | Name of the running container |
215+
| TERMINUSDB_REPOSITORY | terminusdb/terminusdb-server | Docker image |
216+
| TERMINUSDB_NETWORK | bridge | Docker network mode |
217+
| TERMINUSDB_TAG | The latest version tag of terminusdb-server | TerminusDB docker image version |
218+
| TERMINUSDB_STORAGE | terminusdb_storage_local | Storage volume name |
219+
| TERMINUSDB_PORT | 6363 | Port to run TerminusDB |
220+
| TERMINUSDB_LOCAL | | Local folder to mount inside container |
221+
| TERMINUSDB_SERVER | 127.0.0.1 | Server on which TerminusDB will run |
222+
| TERMINUSDB_PASS | root | Password for accessing TerminusDB |
223+
| TERMINUSDB_AUTOLOGIN | false | Whether the administration console should automatically login |
224+
| TERMINUSDB_CONSOLE | http://127.0.0.1/console | URL for browser top open console |
225+
| TERMINUSDB_CONSOLE_BASE_URL | https://unpkg.com/@terminusdb/terminusdb-console@SOME_VERSION/console/dist/ | URL to hosted console |
226+
| TERMINUSDB_HTTPS_ENABLED | false | Enable HTTPS |
227+
| TERMINUSDB_SSL_CERT | A self signed cert | Path to SSL cert inside terminusdb-server container |
228+
| TERMINUSDB_SSL_CERT_KEY | A self-created private key | Path to private key for SSL cert inside container |
229+
230+
## Examples
210231

211232
These are examples of environment variables you can set when running
212233
`./terminusdb-container`.

RELEASE_NOTES.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
TerminusDB Quickstart Version 2.0 Release Notes
1+
# TerminusDB Quickstart Version 2.0.1 Release Notes
22

33
## New
44

5-
TerminusDB Quickstart 2.0 is updated for use with TerminusDB Server 2.0, see release notes in [TerminusDB Server](https://github.com/terminusdb/terminusdb-server) for details.
5+
- Updated version of TerminusDB console.
6+
7+
See release notes in [TerminusDB Console](https://github.com/terminusdb/terminusdb-console) for details.
8+
9+
- Added exec feature to run commands inside container.
10+
- Add build and end-to-end tests for TerminusdB console.
11+
- Add improved importing of environment variables in tests.
12+
- run TerminusDB server tests from bats tests.
13+
14+
# TerminusDB Quickstart Version 2.0 Release Notes
15+
16+
## New
17+
18+
# TerminusDB Quickstart 2.0 is updated for use with TerminusDB Server 2.0, see release notes in [TerminusDB Server](https://github.com/terminusdb/terminusdb-server) for details.
619

720
## Backwards-Incompatible Changes
821

0 commit comments

Comments
 (0)