Make running integration tests easier

This commit is contained in:
ViViDboarder 2021-07-23 15:28:19 -07:00
parent 5fd947f127
commit 0ea5eadd71
2 changed files with 39 additions and 0 deletions

View File

@ -33,6 +33,24 @@ run-debug: target/debug/vaultwarden_ldap
test:
cargo test
# Run bootstrapped integration test
.PHONY: itest
itest:
docker-compose -f docker-compose.yml \
-f itest/docker-compose.itest.yml \
up --build
# Run bootstrapped integration test using env for config
.PHONY: itest-env
itest-env:
docker-compose -f docker-compose.yml \
-f itest/docker-compose.itest-env.yml \
up --build
.PHONY: clean-itest
clean-itest:
docker-compose down -v
# Installs pre-commit hooks
.PHONY: install-hooks
install-hooks:

View File

@ -0,0 +1,21 @@
---
version: '3'
services:
ldap_sync:
environment:
CONFIG_PATH: ""
APP_VAULTWARDEN_URL: "http://vaultwarden:80"
APP_VAULTWARDEN_ADMIN_TOKEN: "admin"
APP_LDAP_HOST: "ldap"
APP_LDAP_BIND_DN: "cn=admin,dc=example,dc=org"
APP_LDAP_BIND_PASSWORD: "admin"
APP_LDAP_SEARCH_BASE_DN: "dc=example,dc=org"
APP_LDAP_SEARCH_FILTER: "(&(objectClass=*)(uid=*))"
APP_LDAP_SYNC_INTERVAL_SECONDS: 10
vaultwarden:
ldap:
command: ["--copy-service"]
volumes:
- ./itest/50-seed-user.ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom/50-seed-user.ldif