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

[ECO-4852] Gather spec items coverage information #1811

Merged
merged 8 commits into from
Jul 18, 2024

Conversation

VeskeR
Copy link
Contributor

@VeskeR VeskeR commented Jul 4, 2024

This PR is based on #1806, please review that one first.

This PR introduces new specCoverageReport.ts script to gather spec items coverage by ably-js tests (from docstring tags) and compare them with the Ably features specification.
Script fetches the latest spec from Ably specification repo using link to the textile file: https://raw.githubusercontent.com/ably/specification/main/textile/features.textile. Then parses textile file and docstrings in ably-js tests to output spec item coverage table.

This PR also adds new Spec coverage report workflow, which simply runs npm run speccoveragereport to output spec coverage report. See job output here.

Here's the unformatted spec coverage data gathered based on test suite state for a1229af commit:
spec-coverage-result.json

@VeskeR VeskeR changed the base branch from main to uts-logs July 4, 2024 09:56
@VeskeR VeskeR force-pushed the ECO-4852/gather-spec-items-coverage branch from 0f52e40 to 1f5d217 Compare July 4, 2024 10:21
@github-actions github-actions bot temporarily deployed to staging/pull/1811/features July 4, 2024 10:22 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/bundle-report July 4, 2024 10:22 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/typedoc July 4, 2024 10:22 Inactive
@VeskeR VeskeR force-pushed the uts-logs branch 2 times, most recently from fe3f050 to 657e484 Compare July 4, 2024 10:47
@VeskeR VeskeR force-pushed the ECO-4852/gather-spec-items-coverage branch from 1f5d217 to 15cc149 Compare July 4, 2024 10:56
@github-actions github-actions bot temporarily deployed to staging/pull/1811/bundle-report July 4, 2024 10:57 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/features July 4, 2024 10:57 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/typedoc July 4, 2024 10:57 Inactive
@VeskeR VeskeR force-pushed the ECO-4852/gather-spec-items-coverage branch from 15cc149 to ef29ffb Compare July 4, 2024 11:05
@github-actions github-actions bot temporarily deployed to staging/pull/1811/bundle-report July 4, 2024 11:06 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/typedoc July 4, 2024 11:06 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/features July 4, 2024 11:06 Inactive
@VeskeR VeskeR force-pushed the ECO-4852/gather-spec-items-coverage branch from ef29ffb to 8eb3a75 Compare July 4, 2024 11:38
@github-actions github-actions bot temporarily deployed to staging/pull/1811/bundle-report July 4, 2024 11:39 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/typedoc July 4, 2024 11:39 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/features July 4, 2024 11:39 Inactive
@VeskeR VeskeR force-pushed the ECO-4852/gather-spec-items-coverage branch from 8eb3a75 to 0d7e54e Compare July 4, 2024 12:04
@github-actions github-actions bot temporarily deployed to staging/pull/1811/bundle-report July 4, 2024 12:04 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/features July 4, 2024 12:05 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/typedoc July 4, 2024 12:05 Inactive
@VeskeR VeskeR force-pushed the ECO-4852/gather-spec-items-coverage branch from 0d7e54e to 595ab00 Compare July 4, 2024 12:41
@github-actions github-actions bot temporarily deployed to staging/pull/1811/features July 4, 2024 12:42 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/bundle-report July 4, 2024 12:42 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/typedoc July 4, 2024 12:42 Inactive
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a great start. I do have some concerns about how we're trying to apply heuristics in order to get around the fact that the spec, as currently written, doesn't allow us to gather great data about how much of it a given test suite implements. I think I’d prefer that we not try and hide these limitations, and then work on improving the spec.

scripts/specCoverageReport.ts Show resolved Hide resolved
scripts/specCoverageReport.ts Outdated Show resolved Hide resolved
scripts/specCoverageReport.ts Outdated Show resolved Hide resolved
VeskeR added 7 commits July 5, 2024 15:33
`dox` is missing type declaration files in its bundle, and no types are
available at `@types/dox`. However, the repository for the package has
the `index.d.ts` file available [1], but it wasn't published to npm.
So I just copied `index.d.ts` from the repo to our codebase for type
definitions.

[1] https://github.com/tj/dox/blob/master/index.d.ts
@VeskeR VeskeR force-pushed the ECO-4852/gather-spec-items-coverage branch from 595ab00 to a5824bb Compare July 5, 2024 14:33
@github-actions github-actions bot temporarily deployed to staging/pull/1811/bundle-report July 5, 2024 14:34 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/features July 5, 2024 14:34 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1811/typedoc July 5, 2024 14:34 Inactive
Stop using arbitrary weight formula for test tags contribution towards
spec coverage. Instead, display amount of tests with full coverage for
a spec item, and amount of tests with partial coverage.

Do not make an assumption in the script about what spec items should be
explicitly tested or not regarding parent/children spec items. Instead
provide a report for each spec item individually. This could be improved
in the future once the spec document is accompanied with some metadata
about the intended way of testing certain spec items.
@VeskeR VeskeR requested a review from ttypic July 17, 2024 15:53
Base automatically changed from uts-logs to main July 17, 2024 15:59
@VeskeR VeskeR merged commit be8abfe into main Jul 18, 2024
13 checks passed
@VeskeR VeskeR deleted the ECO-4852/gather-spec-items-coverage branch July 18, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants