CARTO VL is an open-source library. We are more than happy to receive your contributions to the code and its documentation.
To clone and run this library, you'll need Node.js >=6.11.5 (which comes with npm) installed on your computer. If you're using yarn instead of npm, please use the last stable version.
Run this commands from your command line:
# Clone this repository
$ git clone https://github.com/CartoDB/carto-vl
# Go into the repository
$ cd carto-vl
# Install dependencies
$ yarn
# Bundle the library
$ yarn build
This is intended for the end-user of the library and it's the source of CARTO VL's Official Documentation. It's available in the directory docs/public
.
# Generate the public documentation
$ yarn docs
# Serve docs and examples
$ yarn serve
# Running the tests
$ yarn test
# To watch the unit tests
$ yarn test:watch
# To launch the unit tests in the browser
$ yarn test:browser
Automatically test the user activity using local data sources (GeoJSON).
# Running the tests
$ yarn test:user
# To watch the user tests
$ yarn test:user:watch
With these you can also test the renderer using local data sources (GeoJSON) and a static map. The local GeoJSON files are located in the common/sources
directory.
# Running the tests
$ yarn test:render
To create new tests, crate a new folder with a new scenario.js
file and run the following command:
yarn test:render:prepare
Manually remove your old reference images and run this command to create new ones:
yarn test:render:prepare
Adding f-
at the beginning of any test folder marks this test to be executed without the rest of the tests.
Adding x-
at the beginning of any test folder marks this test to be ignored.
This end to end tests cover the entire library by performing tests against real servers. This is done through iterative screenshot testing, comparing test
screenshots against its reference images. To achieve real E2E testing, a Windshaft-cartodb server is deployed within a Docker container.
To install Docker, follow the instructions on https://docs.docker.com/install/
# Running the tests
$ yarn test:e2e
To rebuild the Docker image run: docker build -t carto/windshaft-cartovl-testing test/acceptance/docker/
To create new tests, crate a new folder with a new scenario.js
file and run the following command:
yarn test:e2e:prepare
Manually remove your old reference images and run this command to create new ones:
yarn test:e2e:prepare
Adding f-
at the beginning of any test folder marks this test to be executed without the rest of the tests.
Adding x-
at the beginning of any test folder marks this test to be ignored.
Our main branch is master
. This branch is stable and has the same content as the last published version. The branch with the new changes for the next major or minor release is develop
.
We follow this convention when naming branches:
- Features:
feature/<id>-<description>
(i.e: feature/1303-add-global-histogram-expression) - Fixes:
fix/<id>-<description>
(i.e: fix/2065-svg-icons-not-working-in-firefox) - Hotfix:
hotfix/<id>-<description>
(i.e: hotfix/1342-revert-api-call) - Release (minor & major):
release/<version>
(i.e: release/v1.2.5)
- Features and Fixes are created from
develop
. PRs must be againstdevelop
. - Hotfix are created from
master
. They contain very small changes that imply a patch release. PRs must be againstmaster
- Release branches must be created from
develop
branch.
When a PR is merged into master
for a patch release, after releasing, we merge master
back into develop
, because develop
always have to be updated with master
.
The release workflow is documented internally.
The Docker configuration lives in /test/acceptance/docker. This configuration includes:
/test/acceptance/docker/config/environments/test.js
- Windshaft configuration file/test/acceptance/docker/test/support/prepare_db.sh
- Database setup/test/acceptance/docker/prepare.sh
- Tests setup/test/acceptance/docker/deploy.sh
- Windshaft & redis setup
If we change the configuration (due to a change in Windshaft, for example) we have to rebuild the Docker images we're using both locally and in our CI environment:
- carto/windshaft-cartovl-testing (local e2e tests)
- carto/windshaft-cartovl-testing-pg10 (CI - using Postgres 10)
- carto/windshaft-cartovl-testing-pg11 (CI - using Postgres 11)
First of all, you need to have access to Docker Hub and login from your local machine. If you don't have an account, please request access.
Make the necessary changes in the configuration files and build each image using this command:
$ docker build -t carto/windshaft-cartovl-testing test/acceptance/docker
$ docker build -t carto/windshaft-cartovl-testing-pg10 test/acceptance/docker
$ docker build -t carto/windshaft-cartovl-testing-pg11 test/acceptance/docker
And finally, push them to Docker Hub:
$ docker push carto/windshaft-cartovl-testing
$ docker push carto/windshaft-cartovl-testing-pg10
$ docker push carto/windshaft-cartovl-testing-pg11