It uses ALMighty-core as the back-end.
If this is the first time you are starting the UI you need to run
$ npm install
If you trying to refresh your install you can run:
$ npm run reinstall
Start the app by executing the following.
$ npm start
If you wish to run the app with the in-memory dataset, you need to set an environment variable "ENV" to "inmemory" and do a rebuild. The setting is stored inside the build, changing the value back to unset or "development" (default for npm start) needs a rebuild to take effect.
To run the TypeScript and Angular 2 linter, use:
$ npm run lint
Note
|
They also run during the unit tests. |
To validate the webpack build, use:
$ npm run validate
Note
|
Validation also runs the unit tests. |
To run the unit test, use:
$ npm run test:unit
To run the unit test in a watch mode so that they are rerun every time you save, use:
$ npm run watch:test
Unit (UI) tests are automatically executed on the PR(pull request) check process (using
cico_run_tests.sh
) or on the release process (using cico_build_deploy.sh
). To executed
these scripts from the development environment you can run the following script:
./run_unit_tests.sh
For unit testing, Jasmine, Karma, Webpack is used. There are unit tests available for
both services and UI components. There are .spec.ts
files available in individual
component or service folder. Karma and Webpack config is written inside config directory
under root.
To run the functional test, use:
$ npm run test:func
Functional (UI) tests are automatically executed on the PR check process (using
cico_run_tests.sh
) or on the release process (using cico_build_deploy.sh
) but
can also be executed from the development environment by invoking the following command:
./run_functional_tests.sh
External resources are mocked. A Java JRE, ncat and fuser have to be available on the
system (see Dockerfile.builder for details on the required packages when building on
Fedora/CentOS). PhantomJS will be used as the browser engine by default. This can be
changed by adding/modifying browser capabilities in protractor.config.js
.
Test specs for functional tests are residing in src/tests
.
To generate production build, set the API URL and run npm
command as give below:
export API_URL="http://api.example.org/api/" npm run build:prod
The build output will be under dist
directory.
To create docker image, run this command immediately after the previous command:
docker build -t almighty-ui-deploy -f Dockerfile.deploy .