Move users_database.yml files to dedicated suites.

pull/330/head
Clement Michaud 2019-03-02 23:16:53 +01:00
parent 4c0bb2ce7f
commit e8d7fe4111
10 changed files with 7 additions and 10 deletions

View File

@ -8,13 +8,11 @@ images/
example/ example/
.travis.yml .travis.yml
config.test.yml
CONTRIBUTORS.md CONTRIBUTORS.md
Dockerfile Dockerfile
docker-compose.* docker-compose.*
Gruntfile.js Gruntfile.js
tslint.json tslint.json
tsconfig.json tsconfig.json
users_database.yml
*.tgz *.tgz

1
test/suites/.gitignore vendored 100644
View File

@ -0,0 +1 @@
users_database.test.yml

View File

@ -10,7 +10,7 @@ default_redirection_url: https://home.example.com:8080/
authentication_backend: authentication_backend:
file: file:
path: ./users_database.yml path: ./test/suites/basic/users_database.test.yml
session: session:
secret: unsecure_session_secret secret: unsecure_session_secret

View File

@ -12,6 +12,7 @@ const dockerEnv = new DockerEnvironment([
]) ])
async function setup() { async function setup() {
await exec(`cp ${__dirname}/users_database.yml ${__dirname}/users_database.test.yml`);
await exec('mkdir -p /tmp/authelia/db'); await exec('mkdir -p /tmp/authelia/db');
await exec('./example/compose/nginx/portal/render.js ' + (fs.existsSync('.suite') ? '': '--production')); await exec('./example/compose/nginx/portal/render.js ' + (fs.existsSync('.suite') ? '': '--production'));
await dockerEnv.start(); await dockerEnv.start();

View File

@ -12,8 +12,9 @@ import { exec } from '../../helpers/utils/exec';
AutheliaSuite('Simple configuration', __dirname, function() { AutheliaSuite('Simple configuration', __dirname, function() {
this.timeout(10000); this.timeout(10000);
beforeEach(async function() { beforeEach(async function() {
await exec('cp users_database.example.yml users_database.yml'); await exec(`cp ${__dirname}/users_database.yml ${__dirname}/users_database.test.yml`);
}); });
describe('Simple authentication', SimpleAuthentication); describe('Simple authentication', SimpleAuthentication);

View File

@ -10,7 +10,7 @@ default_redirection_url: https://home.example.com:8080/
authentication_backend: authentication_backend:
file: file:
path: ./users_database.yml path: ./test/suites/short-timeouts/users_database.test.yml
session: session:
secret: unsecure_session_secret secret: unsecure_session_secret

View File

@ -12,6 +12,7 @@ const dockerEnv = new DockerEnvironment([
]) ])
async function setup() { async function setup() {
await exec(`cp ${__dirname}/users_database.yml ${__dirname}/users_database.test.yml`);
await exec('mkdir -p /tmp/authelia/db'); await exec('mkdir -p /tmp/authelia/db');
await exec('./example/compose/nginx/portal/render.js ' + (fs.existsSync('.suite') ? '': '--production')); await exec('./example/compose/nginx/portal/render.js ' + (fs.existsSync('.suite') ? '': '--production'));
await dockerEnv.start(); await dockerEnv.start();

View File

@ -1,12 +1,7 @@
import AutheliaSuite from "../../helpers/context/AutheliaSuite"; import AutheliaSuite from "../../helpers/context/AutheliaSuite";
import Inactivity from './scenarii/Inactivity'; import Inactivity from './scenarii/Inactivity';
import { exec } from '../../helpers/utils/exec';
AutheliaSuite('Short timeouts', __dirname, function() { AutheliaSuite('Short timeouts', __dirname, function() {
this.timeout(10000); this.timeout(10000);
beforeEach(async function() {
await exec('cp users_database.example.yml users_database.yml');
});
describe('Inactivity period', Inactivity); describe('Inactivity period', Inactivity);
}); });