Skip to content
Snippets Groups Projects

New read me how to develop on faidare

2 files
+ 46
3
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 44
1
@@ -70,7 +70,50 @@
### Test data
`docker compose up` will start an Elasticsearch instance
`./scripts/harvest.sh -jsonDir data/test/ -es_host localhost -env dev -v` will load the test data with the necessary indices and mappings.
--`./scripts/harvest.sh -jsonDir data/test/ -es_host localhost -env dev -v` will
To load the test data with the necessary indices and mappings, you can use one of the following methods:
1. Using the Docker image (recommended for simplicity and consistency).
2. Running the script locally on your machine.
#### Option 1: Using the Docker Image
For detailed instructions on using the FAIDARE Docker image, refer to the relevant section in the [README.md](https://forgemia.inra.fr/urgi-is/faidare/-/blob/fix/NewReadMeHowToDevelopOnFaidare/README.md#data-harvesting-and-indexing).
**Note**: Replace /path/to/local/data with the data/test/ directory when running the Docker command, for example for Linux:
```sh
docker run -t --volume /path/to/local/data:/opt/data/ --network=container:elasticsearch-faidare registry.forgemia.inra.fr/urgi-is/docker-rare/faidare-loader:latest -jsonDir /opt/data/
```
#### Option 2: Running the Script Locally
If you prefer, you can run the `harvest.sh` script directly on your machine. However, please ensure the following dependencies are installed:
- jq (v1.6+): https://github.com/stedolan/jq/releases/tag/jq-1.6
- GNU parallel: https://www.gnu.org/software/parallel/
- gzip: http://www.gzip.org/
**Instructions by Operating System**
1. Linux: Run the script as follows:
`./scripts/harvest.sh -jsonDir data/test/ -es_host localhost -env dev -v`
2. macOS: Ensure GNU utilities like readlink are available. If using a macOS-specific environment, you might need to install them using Homebrew:
`brew install coreutils gnu-parallel jq gzip`
Then run:
`./scripts/harvest.sh -jsonDir data/test/ -es_host localhost -env dev -v`
3. Windows: You can run the script using a Bash environment like Git Bash, WSL, or Cygwin. Ensure all required dependencies are installed within the environment:
`./scripts/harvest.sh -jsonDir data/test/ -es_host localhost -env dev -v`
Note for macOS and Windows users: Compatibility issues might arise due to system differences. If you encounter any issues, it is recommended to use the Docker-based method.
## Run backend tests
After loading test data into your local Elasticsearch instance, you can run the following command to run backend tests:
`./gradlew test jacocoTestReport -s sonarqube`
## Testing recommendations
Behaviour driven development (upon [TDD](https://dannorth.net/2012/05/31/bdd-is-like-tdd-if/)) is recommended for all new developments.
Loading