You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: indexer/README.md
+33-19Lines changed: 33 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,42 +151,56 @@ yarn dev:hot:graphql
151
151
The following commands will aid in the maintenance of the indexer.
152
152
153
153
```bash
154
-
# Identifying Missing Blocks - Scan for and store any blocks that were missed.
154
+
# Identifying Missing Blocks - Scan for and store any blocks that were missed in the streaming process.
155
155
yarn dev:missing
156
156
157
-
# Processing Headers - Start the header processing from S3 to the database.
158
-
yarn dev:headers
159
-
160
-
# Processing Payloads - Start the payload processing from S3 to the database.
161
-
yarn dev:payloads
162
-
163
157
# Update GraphQL - Makers a hot reload (without building)
164
158
yarn dev:hot:graphql
165
159
166
160
# Generate GraphQL types - Generate the GraphQL types from the schema.
167
161
yarn graphql:generate-types
162
+
```
163
+
164
+
## 6. Running Tests
168
165
169
-
# Run the pagination tests offline
170
-
yarn test
166
+
The Kadena Indexer project includes several types of tests to ensure the functionality and reliability of the codebase. Below are the instructions to run these tests:
167
+
168
+
### 6.1. Unit Tests
169
+
170
+
Unit tests are designed to test individual components or functions in isolation. To run the unit tests, use the following command:
171
+
172
+
```bash
173
+
yarn test:unit
171
174
```
172
175
173
-
### 5.3. Local Workflow Testing
176
+
This command will execute all the unit tests located in the `tests/unit` directory.
174
177
175
-
**NOTE:** This is not being actively maintained at the moment.
178
+
### 6.2. Integration Tests
176
179
177
-
Install act for local testing:
180
+
Integration tests are used to test the queries and subscriptions of the GraphQL API. To run the integration tests, use the following command:
178
181
179
182
```bash
180
-
# For MacOS
181
-
brew install act
183
+
yarn test:integration
184
+
```
185
+
186
+
This command will execute the integration tests located in the `tests/integration` directory, using the environment variables specified in the `.env.testing` file.
187
+
188
+
### 6.3. Specific Integration File Test
189
+
190
+
File tests are executed using the same environment as the integration tests. To run a specific integration test (eg. events), use the following command:
Then run the indexer workflow by using the following command:
196
+
This command will run tests using the environment variables from the `.env.testing` file.
197
+
198
+
### 6.4. Smoke Tests
199
+
200
+
Smoke tests are a subset of integration tests that verify the basic functionality of the application. To run the smoke tests, use the following command:
189
201
190
202
```bash
191
-
yarn run-indexer-workflow
203
+
yarn test:smoke
192
204
```
205
+
206
+
This command will start the necessary services using Docker Compose, wait for a few seconds to ensure they are up and running, execute the smoke tests located in `tests/docker/smoke.test.ts`, and then shut down the services.
0 commit comments