Skip to content

Commit

Permalink
tannerjones4075- update developer guide (#385)
Browse files Browse the repository at this point in the history
* Updating DEVELOPER_GUIDE.md file to include docker build instructions

Signed-off-by: Tanner Jones <[email protected]>

* Updating DEVELOPER_GUIDE.md file to include docker build instructions

Signed-off-by: Tanner Jones <[email protected]>

* Updating DEVELOPER_GUIDE.md file and CHANGELOG

Signed-off-by: Tanner Jones <[email protected]>

* Removed link from localhost:9200

Signed-off-by: Tanner Jones <[email protected]>

---------

Signed-off-by: Tanner Jones <[email protected]>
  • Loading branch information
tannerjones4075 authored Oct 4, 2023
1 parent a8eefba commit 02c73d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Read, close and replace the http Reponse Body ([#300](https://github.com/opensearch-project/opensearch-go/pull/300))
- Updated and adjusted golangci-lint, solve linting complains for signer ([#352](https://github.com/opensearch-project/opensearch-go/pull/352))
- Solve linting complains for opensearchtransport ([#353](https://github.com/opensearch-project/opensearch-go/pull/353))
- Updated Developer guide to include docker build instructions ([#385]https://github.com/opensearch-project/opensearch-go/pull/385)

### Deprecated

Expand Down
18 changes: 16 additions & 2 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
- [Windows](#windows)
- [Unit Testing](#unit-testing)
- [Integration Testing](#integration-testing)
- [Composing an OpenSearch Docker Container](#composing-an-opensearch-docker-container)
- [Execute integration tests from your terminal](#execute-integration-tests-from-your-terminal)
- [Lint](#lint)
- [Markdown lint](#markdown-lint)
- [Lint](#lint)
- [Markdown lint](#markdown-lint)
- [Use an Editor](#use-an-editor)
- [GoLand](#goland)

Expand Down Expand Up @@ -61,6 +62,19 @@ go test -v -run TestName;

In order to test opensearch-go client, you need a running OpenSearch cluster. You can use Docker to accomplish this. The [Docker Compose file](.ci/opensearch/docker-compose.yml) supports the ability to run integration tests for the project in local environments. If you have not installed docker-compose, you can install it from this [link](https://docs.docker.com/compose/install/).

### Composing an OpenSearch Docker Container

Ensure that Docker is installed on your local machine. You can check by running `docker --version`. Next, navigate to your local OpenSearch repository where the docker-compose.yaml file is stored. Run the following command to build the docker container.

```
cd opensearch/.ci/opensearch
docker-compose -f docker-compose.yml up
```

This command will start the OpenSearch container using the `docker-compose.yaml` configuration file. During the build process, the necessary dependencies and files will be downloaded, which may take some time depending on your internet connection and system resources.

Once the container is built and running, you can open a web browser and navigate to localhost:9200 to access the OpenSearch docker container.

In order to differentiate unit tests from integration tests, Go has a built-in mechanism for allowing you to logically separate your tests with [build tags](https://pkg.go.dev/cmd/go#hdr-Build_constraints). The build tag needs to be placed as close to the top of the file as possible, and must have a blank line beneath it. Hence, create all integration tests with build tag 'integration'.

#### Execute integration tests from your terminal
Expand Down

0 comments on commit 02c73d7

Please sign in to comment.