2018-08-26 21:46:15 +00:00
|
|
|
# Build
|
|
|
|
|
2018-11-16 07:39:57 +00:00
|
|
|
**Authelia** is written in Typescript and built with [Grunt](https://gruntjs.com/).
|
2018-08-26 21:46:15 +00:00
|
|
|
|
|
|
|
In order to build **Authelia**, you need to make sure Node v8 and NPM is
|
|
|
|
installed on your machine.
|
|
|
|
|
|
|
|
Then, run the following command install the node modules:
|
|
|
|
|
|
|
|
npm install
|
|
|
|
|
|
|
|
And, this command to build **Authelia** under dist/:
|
|
|
|
|
|
|
|
./node_modules/.bin/grunt build
|
|
|
|
|
|
|
|
## Details
|
|
|
|
|
|
|
|
### Build
|
|
|
|
|
|
|
|
**Authelia** is made of two components: the client and the server.
|
|
|
|
|
|
|
|
The client is written in Typescript and uses jQuery. It is built as part of
|
|
|
|
the global `build` Grunt command.
|
|
|
|
|
2018-11-16 07:39:57 +00:00
|
|
|
The server is written in Typescript. It is also built as part of the global `build`
|
2018-08-26 21:46:15 +00:00
|
|
|
Grunt command.
|
|
|
|
|
|
|
|
### Tests
|
|
|
|
|
|
|
|
Grunt also handles the commands to run the tests. There are several type of
|
2018-11-16 07:39:57 +00:00
|
|
|
tests for **Authelia**: unit tests for the server, the client and a shared
|
|
|
|
library and an integration test suite testing both components together.
|
2018-08-26 21:46:15 +00:00
|
|
|
|
|
|
|
The unit tests are written with Mocha while integration tests are using
|
|
|
|
Cucumber and Mocha.
|
|
|
|
|
|
|
|
### Unit tests
|
|
|
|
|
|
|
|
To run the client unit tests, run:
|
|
|
|
|
|
|
|
./node_modules/.bin/grunt test-client
|
|
|
|
|
|
|
|
To run the server unit tests, run:
|
|
|
|
|
|
|
|
./node_modules/.bin/grunt test-server
|
|
|
|
|
2018-11-16 07:39:57 +00:00
|
|
|
To run the shared library unit tests, run:
|
|
|
|
|
|
|
|
./node_modules/.bin/grunt test-shared
|
|
|
|
|
2018-08-26 21:46:15 +00:00
|
|
|
### Integration tests
|
|
|
|
|
|
|
|
Integration tests are mainly based on Selenium so they
|
2018-11-16 07:39:57 +00:00
|
|
|
need a complete environment to be run.
|
2018-08-26 21:46:15 +00:00
|
|
|
|
2018-11-16 07:39:57 +00:00
|
|
|
You can start by making sure **Authelia** is built with:
|
2018-08-26 21:46:15 +00:00
|
|
|
|
|
|
|
grunt build
|
|
|
|
|
|
|
|
and the docker image is built with:
|
|
|
|
|
|
|
|
./scripts/example-commit/dc-example.sh build
|
|
|
|
|
|
|
|
Then, start the environment with:
|
|
|
|
|
|
|
|
./scripts/example-commit/dc-example.sh up -d
|
|
|
|
|
|
|
|
And run the tests with:
|
|
|
|
|
|
|
|
./node_modules/.bin/grunt test-int
|
|
|
|
|
|
|
|
Note: the Cucumber tests are hard to maintain and will therefore
|
|
|
|
be refactored to use Mocha instead.
|