Skip to content

Commit c10094b

Browse files
committed
Document executuion of tests.
1 parent 47e9411 commit c10094b

File tree

5 files changed

+65
-5
lines changed

5 files changed

+65
-5
lines changed

TESTING.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ the following command:
1919
npm run test:unit
2020
```
2121

22-
## Integration Tests
22+
## Automated Integration Tests
2323

2424
Integration tests execute against a live neptune db cluster or graph and require
2525
the following prerequisites to run:
@@ -54,6 +54,66 @@ To execute the integration tests use the following command:
5454
npm run test:integration
5555
```
5656

57+
## Manual Integration Tests
58+
59+
In addition to the automated integration tests, there are manual integration
60+
tests that can be run against live AWS AppSync APIs and Apollo Server instances
61+
that were deployed via the Amazon Neptune Utility for GraphQL. These tests are
62+
useful for validating deployed GraphQL APIs that are interfacing Neptune db or
63+
analytics graphs loaded with the airports sample data.
64+
65+
### AppSync Manual Tests
66+
67+
These tests execute queries against a deployed AWS AppSync API:
68+
69+
#### Standard AppSync Queries
70+
71+
```
72+
node --experimental-vm-modules node_modules/jest/bin/jest.js test/appSyncAirRoutesQueries.test.js
73+
```
74+
75+
#### Custom AppSync Queries
76+
77+
```
78+
node --experimental-vm-modules node_modules/jest/bin/jest.js test/appSyncCustomAirRoutesQueries.test.js
79+
```
80+
81+
**Prerequisites for AppSync tests:**
82+
83+
- Set environment variables:
84+
```
85+
export APP_SYNC_API_ID=your-appsync-api-id
86+
export APP_SYNC_API_KEY=your-api-key
87+
export APP_SYNC_REGION=your-aws-region
88+
```
89+
90+
### Apollo Server Manual Tests
91+
92+
These tests execute queries against a local Apollo Server instance:
93+
94+
#### Standard Apollo Queries
95+
96+
```
97+
node --experimental-vm-modules node_modules/jest/bin/jest.js test/apolloAirRoutesQueries.test.js
98+
```
99+
100+
#### Custom Apollo Queries
101+
102+
```
103+
node --experimental-vm-modules node_modules/jest/bin/jest.js test/apolloCustomAirRoutesQueries.test.js
104+
```
105+
106+
### Test Query Suites
107+
108+
Both test suites use JSON files containing GraphQL queries and expected results:
109+
110+
- **`air-routes-queries.json`**: Standard queries including filters, sorting,
111+
pagination, variables, and fragments
112+
- **`custom-air-routes-queries.json`**: Custom queries using `@graphQuery`
113+
directives, Gremlin queries, and custom field resolvers. These queries assume
114+
that the utility was executed with option
115+
`--input-schema-changes-file ./test/air-routes-changes.json`
116+
57117
## Loading Airports Sample Data Into Neptune
58118

59119
The easiest way to load the airports sample data into Neptune is using

test/apolloAirRoutesQueries.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { testApolloQueries } from "./testLib.js";
44
* Executes a standard set of queries against Apollo Server running on localhost:4000.
55
*/
66
describe('Execute Standard Air Routes Queries - Apollo Server', () => {
7-
testApolloQueries('./air-routes-queries.json');
7+
testApolloQueries('./test/air-routes-queries.json');
88
});

test/apolloCustomAirRoutesQueries.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import { testApolloQueries } from "./testLib.js";
55
* Tests against Apollo Server running on localhost:4000.
66
*/
77
describe('Execute Custom Air Routes Queries - Apollo Server', () => {
8-
testApolloQueries('./custom-air-routes-queries.json');
8+
testApolloQueries('./test/custom-air-routes-queries.json');
99
});

test/appSyncAirRoutesQueries.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { testAppSyncQueries } from './testLib.js';
44
* Executes a standard set of queries against an AppSync API.
55
*/
66
describe('Execute Standard Air Routes Queries', () => {
7-
testAppSyncQueries('./air-routes-queries.json');
7+
testAppSyncQueries('./test/air-routes-queries.json');
88
});

test/appSyncCustomAirRoutesQueries.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { testAppSyncQueries } from './testLib.js';
44
* Executes queries that are added to the graphQL schema via --input-schema-changes-file air-routes-changes.json.
55
*/
66
describe('Execute Custom Air Routes Queries', () => {
7-
testAppSyncQueries('./custom-air-routes-queries.json');
7+
testAppSyncQueries('./test/custom-air-routes-queries.json');
88
});

0 commit comments

Comments
 (0)