Contribute
PRs welcome!
Here’s how to get started.
- Find an existing issue to work on or create a new one (please label as ‘bug’ or ’enhancement’ as appropriate)
- Use the issue comments to discuss what approach you want to take
- Fork the repo
- Get it running locally (see below)
- Make your changes, including unit and acceptance tests
- Submit a PR
Build & run
Prerequisites: Docker, Node, NPM
Install local tooling and NPM scripts:
npm iIn a container
npm startStarts the Blinkfile app at http://localhost:8020 and the documentation at http://localhost:8021
Default login credentials are defined in ./.local/docker-compose.yml
In a container with live reload
Recommended for development
Uses Air for live reload
npm run devStarts the Blinkfile app at http://localhost:8020
On your host machine
Requires Go
Required environment variables:
- ADMIN_USERNAME
- ADMIN_PASSWORD
npm run host:install
go run ./...Lint
Run linters
npm run lintTest
Run the full test suite
npm testRun unit tests with coverage
npm run test:unit:coverOpen coverage.html in a browser to view the coverage report.
Run acceptance tests
This also builds & runs the app in a containerized environment
npm run test:acceptanceOpen Cypress UI to run and develop acceptance tests
npm run cypress:openThis requires the app to be running locally on port 8020 with ENABLE_TEST_AUTOMATION=true, ADMIN_USERNAME=admin, ADMIN_PASSWORD=1234123412341234 which is what is run by default with npm start. The Cypress UI will open and you can select the feature file you want to run.
Gherkin-style features are defined in test/cypress/features. Any scenarios tagged with @pending or @implementing
will not be run in the CI pipeline. Scenarios tagged with @implementing will show up in the test runner locally.
To run only the tests tagged with @implementing so you don’t need to run the entire spec’s test suite while iterating:
npm run cypress:open:implementingCypress implementation steps are defined in test/cypress/steps. See
badeball’s cypress-cucumber-preprocessor docs
for more details.
All new features should have a minimal set of acceptance tests to cover the happy path and important edge cases.
Documentation
Built with Hugo in the /docs directory using McShelby’s relearn theme.
Run Hugo dev server
npm run docsStarts the server on http://localhost:8021 and watches for any changes. You can pass arguments to the Hugo CLI through NPM after the -- without needing to install it locally, like so:
npm run hugo -- version
npm run hugo -- --helpConventional Commits
This project uses Conventional Commits with the commitlint conventional presets.
After staging your changes in Git, you can use npm run commit. This will prompt you to fill in the commit message fields and then generate the commit message for you.
Git Hooks
This project uses git hooks defined in the .githooks/ directory, to help with the local workflow. This is recommended to reduce the chance of pipeline failures.
To install the hooks, run:
npm i
npm run prepareTo skip the hooks for a specific git command, use the -n/--no-verify flag, for instance:
git commit -m "..." -nTo remove them, run:
git config --unset core.hooksPath