-
Notifications
You must be signed in to change notification settings - Fork 316
How to build and contribute
If you wish to build from source or contribute follow the steps below.
Make sure you have installed the following packages:
The cloned repository has the following directory structure:
-
redisinsight/ui
- Contains the frontend code -
redisinsight/api
- Contains the backend code -
docs
- Contains the documentation -
scripts
- Build scripts and other build-related files -
configs
- Webpack configuration files and other build-related files -
tests
- Contains e2e tests
Before development or building, install the following required dependencies
yarn install && yarn --cwd redisinsight/api/
Run yarn build:statics
or yarn build:statics:win
for Windows
After you have installed all dependencies you can package the app.
Run yarn package:prod
to package app for the local platform:
yarn package:prod
The packaged installer will become available in the folder ./release.
There are 2 ways to develop:
After you have installed all dependencies you can now run the app.
Run yarn start
to start an electron application that will watch and build for you.
yarn start
Run yarn --cwd redisinsight/api/ start:dev
to start a local API at localhost:5540
.
yarn --cwd redisinsight/api/ start:dev
While the API is running, open your browser and navigate to http://localhost:5540/api/docs. You should see the Swagger UI.
Run yarn dev:ui
to start a local server for UI.
yarn dev:ui
Web interface will be available at http://localhost:8080.
Now servers will watch for changes and automatically build for you.
yarn test
yarn --cwd redisinsight/api test
yarn --cwd redisinsight/api test:cov
yarn --cwd redisinsight/api test:api
yarn --cwd redisinsight/api test:api:cov
NOTE: Using
yarn test:api*
scripts you should have redis server up and running.
By default tests will look onlocalhost:6379
without any auth.
To customize tests configs, you should run test with proper environment variables.
Example:
If you have redis server running on a different host or port somehost:7777
with default user pass somepass
You should run test commands with such environment variables
TEST_REDIS_HOST=somehost \
TEST_REDIS_PORT=7777 \
TEST_REDIS_PASSWORD=somepass \
yarn --cwd redisinsight/api test:api
You can find all possible environment variable available in the constants.ts file
Here you should not care about tests and local redis database configuration
We will spin up server inside docker container and run tests over it
./redisinsight/api/test/test-runs/start-test-run.sh -r oss-st-6
- -r - is the Redis Test Environment name
We are supporting several test environments to run tests on various Redis databases:
- oss-st-5 - OSS Standalone v5
- oss-st-5-pass - OSS Standalone v5 with admin pass required
- oss-st-6 - OSS Standalone v6 and all modules
- oss-st-6-tls - OSS Standalone v6 with TLS enabled
- oss-st-6-tls-auth - OSS Standalone v6 with TLS auth required
- oss-clu - OSS Cluster
- oss-clu-tls - OSS Cluster with TLS enabled
- oss-sent - OSS Sentinel
- re-st - Redis Enterprise with Standalone inside
- re-clu - Redis Enterprise with Cluster inside
Install E2E tests deps
yarn --cwd tests/e2e
Run E2E tests
yarn --cwd tests/e2e test:chrome