confluentinc / confluentinc/vscode

Clean up `tests/` subdirectory structure

Open
#2,044 0 comments 0 reactions 3 assignees Claimed by @jlrobins View on GitHub
cleanup testing
Dominant language
TypeScript
Stars
34
Forks
17
Avg merge
1d 22h
Merged PRs (30d)
8

Description

It's currently a mixed bag of various levels of subdirectories, not-quite-right names, and could use a cleanup for easier navigation and maintainability.

Image

Since Mocha tests are all created alongside their counterpart `*.ts` files, anything Mocha-related under `tests/` should be generic helper functions and any fixtures.

`tests/e2e/` mainly houses the E2E tests themselves along with a dedicated `utils/`, but I think we could migrate to something like:

```
tests/
├── README.md # (current overview)
├── unit/ # Unit test support (Mocha/Sinon)
│ ├── fixtures/ # Fixtures for Mocha tests (what is currently `tests/unit/testResources/`)
│ │ ├── environments.ts
│ │ ├── flinkStatements.ts
│ │ ├── schemas.ts
│ │ └── ...
│ ├── stubs/ # Sinon stub-related helper functions (what is currently `tests/stubs/`)
│ │ ├── resourceLoaders.ts
│ │ ├── sidecar.ts
│ │ └── notifications.ts
│ └── utils/ # General-purpose helper functions for tests
│ ├── testUtils.ts
│ ├── createResultsManager.ts
│ └── eventually.ts
├── e2e/ # (current E2E Playwright tests)
│ ├── playwright.config.ts
│ ├── fixtures/ # Fixtures only for E2E tests
│ │ └── ...
│ ├── specs/ # (current test specifications themselves)
│ │ ├── confluent.spec.ts
│ │ ├── flinkStatement.spec.ts
│ │ ├── schemas.spec.ts
│ └── utils/ # E2E test utilities
│ ├── confluent.ts
│ ├── docker.ts
│ └── ...
└── shared/ # If needed, shared space between both unit and E2E tests
├── fixtures/
└── utils/
```

Also make sure to update https://github.com/confluentinc/vscode/blob/main/tests/README.md#folder-structure

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.