Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CCI] Update Developer Guide #436

Merged
merged 8 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Added
- Add release details to releasing.md ([319](https://github.com/opensearch-project/opensearch-js/pull/319))
- Added Amazon OpenSearch Serverless in user_guide ([#372](https://github.com/opensearch-project/opensearch-js/issues/372))
- Add guidelines on installing yarn, dependencies; instructions on running ESLint in developer_guide ([#439](https://github.com/opensearch-project/opensearch-js/issues/435))
### Dependencies
- Bumps `aws4` from 1.11.0 to 1.12.0
- Bumps `minimist` from 1.2.6 to 1.2.8
Expand All @@ -22,6 +23,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Changed
- Remove test artifacts from gh_pages workflow ([#335](https://github.com/opensearch-project/opensearch-js/issues/335))
- Make fields in `BulkOperation` optional to match OpenSearch Bulk API requirements ([#378](https://github.com/opensearch-project/opensearch-js/pull/378))
- Remove guidance on using npm and switch completely to yarn in developer_guide ([#439](https://github.com/opensearch-project/opensearch-js/issues/435))
### Deprecated
### Removed
### Fixed
Expand Down Expand Up @@ -80,4 +82,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

[2.1]: https://github.com/opensearch-project/opensearch-js/releases/tag/2.1.0
[2.2]: https://github.com/opensearch-project/opensearch-js/releases/tag/2.2.0
[Unreleased]: https://github.com/opensearch-project/opensearch-js/compare/2.2...HEAD
[Unreleased]: https://github.com/opensearch-project/opensearch-js/compare/2.2...HEAD
46 changes: 41 additions & 5 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
- [Git Clone OpenSearch Node.js Client Repository](#git-clone-opensearch-nodejs-client-repository)
- [Install Prerequisites](#install-prerequisites)
- [Node.js](#nodejs)
- [Yarn](#yarn)
- [Docker](#docker)
- [Installing Dependencies](#installing-dependencies)
- [Using ESLint](#using-eslint)
- [Unit Testing](#unit-testing)
- [Integration Testing](#integration-testing)
- [Execute integration tests from your terminal](#execute-integration-tests-from-your-terminal)
Expand All @@ -25,30 +28,63 @@ e.g. `git clone https://github.com/[your username]/opensearch-js.git`.

The minimum supported version of Node.js is v10.

#### Yarn

This project uses yarn as it's package manager. You can use npm to install yarn:

```
npm install --global yarn
```

#### Docker

[Docker](https://docs.docker.com/install/) is required for building some OpenSearch artifacts and executing integration tests.

### Installing Dependencies

To install all the dependencies needed for this project, run

```
yarn install
```

### Using ESLint

To do a ESLint check on the project, run:

```
yarn run lint
```

To let ESLint to fix errors in your code automatically, run:

```
yarn run lint:fix
```

This will instruct ESLint to try to fix as many issues as possible. The fixes are made to the actual files themselves and only the remaining unfixed issues are output.

Not all problems are fixable using this option, and some of them you will need to fix manually.

### Unit Testing

Go to your terminal and run:

```
cd folder-path
npm run test:unit
yarn run test:unit
```

To run a specific unit test, you can use the following jest command. `npm test` will not work.
To run a specific unit test, you can use the following jest command. `yarn test` will not work.

```
cd folder-path/to/test
jest TestName
```

If you don't have jest, you can install it via npm or yarn
If you don't have jest, you can install it via yarn

```
npm i -g jest-cli
yarn global add jest-cli
```

Expand All @@ -69,7 +105,7 @@ If you have not installed docker-compose, you can install it from this [link](ht

2. Run all integration tests.
```
npm run test:integration:helpers
yarn run test:integration:helpers
```
3. Stop and clean containers.
```
Expand Down