Development • SauceLabs / BrowserStack
As a developer, you have to build the project using npm (ui/
folder).
The following commands are available:
# Run the project
$ npm start
# Run the unit tests
$ ng test --watch=false
# Run lint
$ ng lint
# Run the e2e tests
$ npm run e2e
# Produces code coverage report
$ ng test --watch --code-coverage --reporters=coverage-istanbul
You can also run the tests on SauceLabs or on BrowserStack:
# Run the unit tests on SauceLabs
$ npm run test-saucelabs-local
# Run the e2e tests on SauceLabs
$ npm run e2e-saucelabs-local
# Run the test on BrowserStack
$ npm run test-browserstack-local
# Run the test on BrowserStack
$ npm run e2e-browserstack-local
When executing E2E tests you can either run a local Docker environment using the Spring Cloud Data Flow provided Docker Compose yaml file or, alternatively, have Protractor bootstrap Docker for you (Docker needs to be running and the Docker Compose command needs to be available in the path).
When using Docker Compose manually, set the environment variable DATAFLOW_SKIP_DOCKER_COMPOSE
to true
. For both options you also need to specify the respective Docker version tags for Spring Cloud Data Flow and Spring Cloud Skipper using the environment variables:
DATAFLOW_VERSION
SKIPPER_VERSION
In some cases the npm-modules or other dependencies may become inconsistent during branch changes. In order to resolve the problem we need to clean out inconsistent dependencies. The following instructions can be used to do this:
- Shutdown the development server if it is running.
- Commit or stash your changes
- Execute the following:
git clean -fx
npm install
- If you stashed your files execute the following:
git stash pop
- Now build the application by executing the following:
ng build --prod
Before you can run tests using SauceLabs, please setup your username and password.
For E2E tests, developers should refrain from using localhost
. Instead, add dataflow.local
to your local DNS hosts file.
$ export SAUCE_USERNAME=your-username
$ export SAUCE_ACCESS_KEY=your-access-key
By default the tests use an embedded version of Sauce Connect. In case you enounter test failures due to bandwidth constraints, you may consider establishing a SauceLabs tunnel using the stand-alone Sauce Connect.
Setup instructions for Sauce Connect can be found here. Use the following environment variables:
$ export SAUCE_CONNECT_USE_EMBEDDED=false
$ export SAUCE_USER=your-sauce-user
$ export SAUCE_API_KEY=your-sauce-key
Before you can run tests using BrowserStack, please setup your username and password:
$ export BROWSER_STACK_USERNAME=your-username
$ export BROWSER_STACK_ACCESS_KEY=your-access-key