microsoft / microsoft/component-detection
Review Poetry detector tests
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 553
- Forks
- 135
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 6
Description
In #184 and #230 we migrated from `Nett` to `Tomlyn` as our TOML parsing library as `Nett` was unsupported and deprecated. We used the `IgnoreMissingProperties` option to allow us to parse `poetry.lock` files which are missing properties defined in our [`PoetryLock`][1] model. Unfortunately, this property was not being respected for objects, like `metadata`.
This issue was fixed in https://github.com/xoofx/Tomlyn/pull/44, and upgrading to `Tomlyn` version `0.15.1` should resolve the issue. However, this _should_ have been caught by [our unit tests][2].
This issue is created to followup on why this was not caught by our tests cases.
See #301 for more context
[1]: https://github.com/microsoft/component-detection/blob/main/src/Microsoft.ComponentDetection.Detectors/poetry/Contracts/PoetryLock.cs
[2]: https://github.com/microsoft/component-detection/blob/b2439a3c67985fb1d13f20e4242eeddd5b65afbc/test/Microsoft.ComponentDetection.Detectors.Tests/PoetryComponentDetectorTests.cs#L26-L55
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with test/Microsoft.ComponentDetection.Detectors.Tests/PoetryComponentDetectorTests.cs, especially lines 26-55, and read the context in #301. Review how the Poetry lock fixture and assertions cover missing properties such as metadata. Done means identifying why the test suite missed the Tomlyn behavior and updating the tests or documenting the gap so the regression would be caught.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100