Skip to content

🤖 Update tests.toml files to latest spec#1893

Merged
mirkoperillo merged 1 commit into
exercism:mainfrom
ErikSchierboom:convert-tests-toml-files
Feb 26, 2021
Merged

🤖 Update tests.toml files to latest spec#1893
mirkoperillo merged 1 commit into
exercism:mainfrom
ErikSchierboom:convert-tests-toml-files

Conversation

@ErikSchierboom
Copy link
Copy Markdown
Member

Track maintainers found that they wanted to add comments to the tests.toml file to e.g. indicate why a test was not included.
Unfortunately, running configlet sync would re-generate the entire file so any manually added comments were lost.

In this PR we're updating the format of tests.toml files to support adding comments.
We do this by creating a separate table for each test case which has description and include fields.
Tracks are then free to add additional fields, like a comment field, but also any other fields they feel might be useful to them.

configlet has not yet been updated to support this new format, but we hope to do this soon. Sorry for the inconvenience.

For more information, see this discussion: exercism/configlet#186

Implementation

The PR expects the tests.toml files to be in their original format:

# <description>
"<uuid>" = <include>

This is transformed to:

[<uuid>]
description = "<description>"
include = <include>

Example

# one factor has multiples within limit
"361e4e50-c89b-4f60-95ef-5bc5c595490a" = true

becomes

[361e4e50-c89b-4f60-95ef-5bc5c595490a]
description = "one factor has multiples within limit"
include = true

Existing comments

As some tracks have manually added comments to tests, we try to detect them by assuming they are either:

  • Added as a line comment before the description (we'll ignore empty lines)
  • Added as an inline comment after boolean include value

For any such manually detected comments, we'll add a comment field.

Tracking

exercism/v3-launch#22

Track maintainers found that they wanted to add comments to the tests.toml file to e.g. indicate _why_ a test was not included.
Unfortunately, running configlet sync would re-generate the entire file so any manually added comments were lost.

In this commit we're updating the format of tests.toml files to support adding comments.
We do this by creating a separate table for each test case which has `description` and `include` fields.
Tracks are then free to add additional fields, like a `comment` field, but also anything they feel might be useful to them.

For more information, see this discussion: exercism/configlet#186
@ErikSchierboom ErikSchierboom added the v3-migration 🤖 Preparing for Exercism v3 label Feb 26, 2021
@mirkoperillo mirkoperillo merged commit 80e8511 into exercism:main Feb 26, 2021
@ErikSchierboom ErikSchierboom added the x:size/tiny Tiny amount of work label Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3-migration 🤖 Preparing for Exercism v3 x:size/tiny Tiny amount of work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants