The main goal of our Travis configuration is to create a JHipster application with the test cases we support and run tests against that application.
They are organized in a specific manner to ensure extensibility, maintainability and log readability.
You don't need to know the rules to add a new use case, just do this :
- Create a jhipster application with our module
- Using JHipster, create the entities you want in your use case
- Run
$ create-travis-case-from-application.sh ~/my-jhipster-application
That's it, you can stop reading this chapter :-D.
All the entities used by the travis build are stored in the directory travis/samples/entities
.
The directories and files must follow these rules :
- Each test case has its own directory inside
travis/samples/entities
- This directory name is composed with a unique three digits number following the previous test case, then some words describing the test case, with
-
as a word separator. - This directory contains all the entities that the test case uses.
- If you want to give more information about the test case, write it in
description.md
. - Any file without a
.json
extension will be ignored when loading the test case.
travis/samples/entities/
├── 000-only-table-name
│ ├── Beverage_000.json
│ ├── Bug_000.json
│ ├── Developer_000.json
│ ├── entities.conf
│ └── Mug_000.json
├── 001-table-with-fields
│ ├── Beverage_001.json
│ ├── Bug_001.json
│ ├── Developer_001.json
│ ├── entities.conf
│ └── Mug_001.json
└── 002-one-to-one-table-only
├── Beverage_002.json
├── Bug_002.json
├── Developer_002.json
├── entities.conf
├── Mug_002.json
└── description.md
The entity file name is something like EntityName_xxx.json
.
Follow these rules :
- It has a suffix, an underscore character followed by the test case identifying number.
- For the main test, the name of the entity must be valid according to JHipster.
- It ends with the extension
.json
.
And of course, the name of the entity will be the same but without the extension.
We don't solve the entities's dependencies, so you must specify them in a configuration file called entities.conf
.
This configuration file is a list of the entities in the correct order, one entity per line.
The following is a valid configuration file.
Beverage_000
Developer_000
Mug_000
Bug_000