Skip to content
Snippets Groups Projects
Commit 4e9ca732 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

ENH: Add tests for minimal functionality

parent 2aa70d4b
No related branches found
No related tags found
1 merge request!2ENH: Add tests for minimal functionality
......@@ -17,6 +17,8 @@ RUN ./install_cpplib.sh
COPY . /caosdb-juliainttest
WORKDIR /caosdb-juliainttest
COPY .docker/caosdb_client.json /caosdb_client.json
# Set-up and run the integration test
CMD export LD_LIBRARY_PATH=/root/.local/lib:$LD_LIBRARY_PATH && \
echo "F_BRANCH = $F_BRANCH" && \
......
{
"connections": {
"default": "julialib-integrationtest",
"julialib-integrationtest": {
"host": "caosdb-server",
"port": 8443,
"server_certificate_path": "/cert/caosdb.cert.pem",
"authentication": {
"type": "plain",
"username": "admin",
"password": "caosdb"
}
},
"local-caosdb": {
"host": "localhost",
"port": 8443,
"server_certificate_path": "some/path/cacert.pem",
"authentication": {
"type": "plain",
"username": "me",
"password": "secret!"
}
}
},
"extension": {
"this is my": "special option"
}
}
......@@ -5,6 +5,7 @@ services:
environment:
CAOSDB_SERVER_HOST: caosdb-server
CAOSDB_SERVER_CERT: /cert/caosdb.cert.pem
CAOSDB_CLIENT_CONFIGURATION: /caosdb_client.json
F_BRANCH: $F_BRANCH
networks:
- docker_caosnet
......
......@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Basic CI infrastructure
* Simple test for the connection to a CaosDB server
* Tests for connecting via config files
### Changed
......
......@@ -7,10 +7,15 @@ environmental variable in such a way that a connection can be established with C
```julia
using CaosDB
CaosDB.Connection.connect()
CaosDB.Connection.connect_manually()
```
i.e., without any explicit arguments to the call to `connect`.
i.e., without any explicit arguments to the call to
`connect_manually`. Also set up a `caosdb_client.json` either in with
a connection named `julialib-integrationtest` as default that connects
to the above server. See the [documentation of
libcaosdb](https://docs.indiscale.com/caosdb-cpplib/) for more
information on the config file.
# Tests
......
......@@ -55,5 +55,14 @@ catch e
end
end
# test whether connection can be established without an error
@test CaosDB.Connection.connect() != nothing
@testset "Test CaosDB" begin
@testset "Test connection" begin
# test whether connection can be established without an error
@test CaosDB.Connection.connect() != nothing
@test CaosDB.Connection.connect("julialib-integrationtest") != nothing
# Test manually
@test CaosDB.Connection.connect_manually() != nothing
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment