70 lines
1.6 KiB
Markdown
70 lines
1.6 KiB
Markdown
# Build
|
|
|
|
**Authelia** is written in Typescript and built with Grunt.
|
|
|
|
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.
|
|
|
|
The server is written in Typescript. It is built as part of the global `build`
|
|
Grunt command.
|
|
|
|
### Tests
|
|
|
|
Grunt also handles the commands to run the tests. There are several type of
|
|
tests for **Authelia**: unit tests for the server, unit tests for the client
|
|
and integration tests for both.
|
|
|
|
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
|
|
|
|
### Integration tests
|
|
|
|
Integration tests are mainly based on Selenium so they
|
|
need a complete environment to be set up.
|
|
|
|
Start by making sure **Authelia** is built with:
|
|
|
|
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.
|