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

Renamed start.ts to test.ts to match lint.ts and merge.ts. #339

Merged
merged 3 commits into from
Jun 12, 2024
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
11 changes: 8 additions & 3 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,20 @@ Tests are organized in folders that match [namespaces](spec/namespaces). For exa

### Running Spec Tests Locally

Set up an OpenSearch cluster with Docker using the default OPENSEARCH_PASSWORD (Recommended):
Set up an OpenSearch cluster with Docker using the default `OPENSEARCH_PASSWORD` (Recommended):
```bash
cd .github/opensearch-cluster
docker-compose up -d
```

Run the tests:
Run the tests (use `--opensearch-insecure` for a local cluster running in Docker that does not have a valid SSL certificate):
```bash
npm run test:spec
npm run test:spec -- --opensearch-insecure
```

Run a specific test story:
```bash
npm run test:spec -- --opensearch-insecure --tests tests/_core/info.yaml
```

If you opt to use a different password, you can set the `OPENSEARCH_PASSWORD` environment variable to the desired password before running `docker-compose up` and every time you run the tests:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"jest": "jest",
"test:unit": "jest --testMatch='**/*.test.ts' --testPathIgnorePatterns=/integ/",
"test:integ": "jest --testMatch='**/integ/*.test.ts' --runInBand",
"test:spec": "ts-node tools/src/tester/start.ts"
"test:spec": "ts-node tools/src/tester/test.ts"
},
"dependencies": {
"@apidevtools/swagger-parser": "^10.1.0",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ChapterOutput } from 'tester/ChapterOutput'
import StoryEvaluator from 'tester/StoryEvaluator'

const spec = (args: string[]): any => {
const start = spawnSync('ts-node', ['tools/src/tester/start.ts'].concat(args), {
const start = spawnSync('ts-node', ['tools/src/tester/test.ts'].concat(args), {
env: { ...process.env, OPENSEARCH_PASSWORD: 'password' }
})
return {
Expand All @@ -26,7 +26,7 @@ const spec = (args: string[]): any => {
}

test('--help', () => {
expect(spec(['--help']).stdout).toContain('Usage: start [options]')
expect(spec(['--help']).stdout).toContain('Usage: test [options]')
})

test('--invalid', () => {
Expand Down
Loading