As part of some recent work, @mishrapratikshya and I noticed that the test for the environment conversion have incorrect assertions. We identified this issue because the conversion code was obviously incorrect from inspection, but the tests were passing.
Example
In this example r is the test input (the data model) and versioned is the test output (the versioned model). The assertions test a mix of r and versioned.
However, This problem pre-dates the functionality we were working on - the test already had this bug. Since many of the conversion tests were copy-pasted and then modified, we suspect that more of our tests may have similar problems. We should inspect all of our converter tests (~20 files) and verify that they are testing the correct things.
Summary
As part of some recent work, @mishrapratikshya and I noticed that the test for the environment conversion have incorrect assertions. We identified this issue because the conversion code was obviously incorrect from inspection, but the tests were passing.
Example
In this example
r
is the test input (the data model) andversioned
is the test output (the versioned model). The assertions test a mix ofr
andversioned
.From: https://github.com/project-radius/radius/blob/main/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go#L259-L270
Next Steps
We are fixing the bugs in the environment conversion tests as part of https://github.com/project-radius/radius/pull/5013/files
However, This problem pre-dates the functionality we were working on - the test already had this bug. Since many of the conversion tests were copy-pasted and then modified, we suspect that more of our tests may have similar problems. We should inspect all of our converter tests (~20 files) and verify that they are testing the correct things.
AB#5867