-
Notifications
You must be signed in to change notification settings - Fork 31
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
Remove low value tests. #205
Conversation
My understanding is that this test a user referencing a github URI in their build command which is a valid workflow. In this case the buildpack is built during the build which is something I think would still need to be tested. |
@ForestEckhardt is this a workflow we actually want to support though? I don't think any of our consumers actually do this. |
- I propose removing the following brats tests, primarily with a view to making BRATS fast enough to tack on to the end of an existing integration run rather than requiring a whole separate environment. - DeployingAnAppWithAnUpdatedVersionOfTheSameBuildpack: We cover this with a unit test. I do not think we also need an integration test - StagingWithBuildpackThatSetsEOL: Not all dependencies have deprecation dates, and we have unit tests to cover this when dependencies do have deprecation dates. - StagingWithADepThatIsNotTheLatestConstrained/StagingWithADepThatIsNotTheLatest: I do not think this provides much value to customers, and we have unit tests to cover this. - DeployAnAppWithSensitiveEnvironmentVariables: I think these sorts of tests are unhelpful. There are an infinite number of negative test cases we can run - validating that the buildpack does perform a specific action is best tested at the unit level (if at all).
345477b
to
c01ca3e
Compare
Ok @ForestEckhardt i put back the |
I think I'm good with this, but wanted to ask about |
We're not unit testing it, because it's not possible to unit test that the droplet has the absence of something until the droplet is created. We could test bits and pieces, but even at the unit test I'd argue that a negative test is not appropriate.
The test was added 7 years ago, when this library was extracted from whatever came before it. I assume it existed long before that too, i just don't know where to look to continue the thread. Regardless of exactly when it was introduced - empirically we haven't ever come close to accidentally doing this (because we've never see this test fail). It seems like a huge stretch to me that after all these years we would suddenly introduce a feature that writes credentials to a disk after we deleted the test that would prevent this. Some hypothetical examples of other negative tests (slightly more unlikely to drive the point home):
None of these happen, and we don't have tests for them. We don't feel the need to add tests because we think it's really unlikely that these outcomes could ever happen. I feel the same for the Again, if you feel really strongly about this we can keep it in. But these tests take time, and i really want to start being more deliberate about what tests we are keeping, and way. Integration test should describe the things that the buildpack does, not the things it doesn't do. A couple more topics that I think we'll be coming back to soon:
|
@robdimsdale makes sense that we can't unit test that, thanks. I just wanted to make sure we're not just saying "this stuff is old and probably not useful, lets just remove it". Having a thoughtful discussion about why this stuff can be removed without too much worry was the goal, and I feel like you've delivered here. Your logic about why we should remove this/it's not super helpful makes sense to me! Btw
Yes |
Summary
This PR removes the brats test listed below. I have two goals with this:
List of tests removed, with justification
DeployingAnAppWithAnUpdatedVersionOfTheSameBuildpack
: We cover this with a unit test. I do not think we also need an integration testStagingWithBuildpackThatSetsEOL
: Not all dependencies have deprecation dates, and we have unit tests to cover this when dependencies do have deprecation dates.StagingWithADepThatIsNotTheLatestConstrained/StagingWithADepThatIsNotTheLatest
: I do not think this provides much value to customers, and we have unit tests to cover this.DeployAnAppWithSensitiveEnvironmentVariables
: I think these sorts of tests are unhelpful. There are an infinite number of negative test cases we can run - validating that the buildpack does perform a specific action is best tested at the unit level (if at all).Future work
I think we could get to the point where we don't need to run brats at all, because we can inline the remaining tests into the integration test for each buildpack:
.profile
test) which should be fairly easily to port into each buildpack's integration test suite and thus remove from brats.