Problem/Motivation
Because of https://www.drupal.org/node/3108648 contrib now support semantic versioning for releases.
That means and existing module with a 8.x-1.0 release can a future release of 2.0.0. New contrib modules will be be able to start with semver releases and never use the legacy release format.
#3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates means the update module pulls in both releases in the XML feed
Currently the tests for contrib assume it releases in the 8.x-1.0 format. Obviously there are tests for Update module for Drupal core that use semantic versioning so in theory that shows that projects with semantic version releases should work but until we have tests for a non-core project using semantic versioning we can't be 100% sure.
In addition contrib projects will can have both legacy, 8.x-1.0 style, and semantic version releases in the same XML feed. We have no tests currently that show that update module will recognise that say 2.0.0 is the next major release after the 8.x-1.x branch.
Proposed resolution
We should have test cases that cover these new types of releases that Drupal.org now allows them.
Types of test cases we need.
- only 8.x-1.0 type releases(our current cases for contrib)
- XML with only semver, 1.0.0 format, releases: Covered in this issue
- XML with both legacy, 8.x-1.0 format, and semver, 1.0.0 format, releases. Covered in #3127168: Create contrib Update test for legacy to semver releases
'
This issue only covers case 2).
We should:
- create a new class
abstract class UpdateSemanticTestBase extends UpdateTestBase - Rename UpdateCoreTest to UpdateSemverCoreTest and extend UpdateSemanticTestBase class
- Move all test methods that deal with release availability from
UpdateCoreTesttoUpdateSemanticTestBase
Not all methods need to be moved such astestLocalActions()andtestServiceUnavailable()which don't deal with availability of releases
AlsotestSecurityCoverageMessage()deals with behaviour that is specific to core. - Once the methods above are moved we will need to replace strings such as 'Drupal' to use a class variable.
We will also need to change asserts for text to new assert methods that will target just the update table for core or contrib depending on class variable. - Create
UpdateSemanticContribTest extends UpdateSemanticTestBaseBy extending
UpdateSemanticTestBaseit will have a all the the test methods need for semantic version releases. - To create the XML needed to support
UpdateSemanticContribTestcopy and rename all thedrupal.*.xmlfor a newsemantic_testmodule.The only XML that does not need to be copied are the XML that support
testSecurityCoverageMessage().To make this process easier to review a script has been created. Currently the script is included in the patch but will need to be removed before commit.
- In #3127168: Create contrib Update test for legacy to semver releases add an additional test
testUpdatesLegacyToSemantic()toUpdateSemanticContribTest.
This test will prove the update module recognise major releases when the XML has both legacy and semantic versions.
Remaining tasks
We determine if the split between tests in UpdateCoreTest and UpdateContribTest still make sense. There are some methods that only make sense for core but now that contrib and core will be able to have semantic versioning we may be able to unify the core and contrib versions of some test methods with a dataProvider that switches the project name.
Test coverage:
- See follow up in ##3127168
Add a test cases for releases in 8.x-8. branch to\Drupal\Tests\update\Functional\UpdateSemverContribTest::testUpdatesLegacyToSemver()since this branch might expose bugs around "8" being a major version. see #17.7 - Add test case where site is on legacy needs to update security release on semver version. Or also maybe on legacy and security release on both current major, legacy, and semver next major. Maybe should be added to a test in securityUpdateAvailabilityProvider() for UpdateSemverContribTest
- See follow up in ##3127168
Add test cases toUpdateSemverContribTestwhere the current major is legacy and unsupported and the next major is semver, supported and recommended
Follow-ups
- #3127177: Move test methods not directly related to updates for the Drupal project into their own class Determine if the split between tests in
UpdateCoreTestandUpdateContribTeststill make sense. There are some methods that only make sense for core but now that contrib and core will be able to have semantic versioning we may be able to unify the core and contrib versions of some test methods with a dataProvider that switches the project name. - #3127168: Create contrib Update test for legacy to semver releases
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #79 | interdiff-73-43e7cc20bff.txt | 11.73 KB | tedbow |
| #78 | interdiff-73-563133bf.txt | 11.95 KB | tedbow |
| #73 | interdiff_71-73.txt | 33.53 KB | vsujeetkumar |
| #73 | 3100386_73.patch | 151.95 KB | vsujeetkumar |
| #71 | interdiff_69-71.txt | 424 bytes | vsujeetkumar |
Issue fork drupal-3100386
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tedbowThese test should cover the bugfix scenario in #3105463: Create tests for recommended bugfix releases
Comment #3
tedbowHere is the first attempt at the patch.
The idea behind it
\Drupal\Tests\update\Functional\UpdateCoreTestcontains 2 types of teststestLocalActions,testServiceUnavailable,testFetchTasksSo here is how I made this patch
UpdateSemanticTestBasetest class. This will have all the tests that are currently inUpdateCoreTestbut should work with both core and contrib using semantic versionUpdateCoreTestnow extendsUpdateSemanticTestBaseUpdateSemanticContribTestthat extends extendsUpdateSemanticTestBaserename almost all 'drupal' strings to 'semantic_tests'
semantic_testmoduleComment #5
tedbowfixing
s/$text/$string
Comment #6
dwwApproach here from #3 sounds great. No time to do a careful review right now, but I hope to look soon. This would be fabulous to land ASAP!
Thanks,
-Derek
Comment #7
tedbowHere is just a reroll.
I working on this. We need at least test for major version update from non-semantic to semantic. For example from 8.x-1.x to 2.x.x
Comment #8
tedbowmy reroll in #7 was probably wrong. Because it copies xml to new copies it probably didn't get recent changes. The same for function from UPdateCoreTest.
Working on it
Comment #9
tedbowHmmm. rerolling this was not fun. Hopefully now that a bunch of issues got committed for the Update module it won't be such a big task next time.
This should past tests but I am still working 8.x-1.x to 2.x.x example and much more clean up.
Comment #10
tedbowThis is the script that I used to create the XML copies. I added this incase we needed to reroll this patch again. Will remove before commit.
This actually makes a few xml files we don't need https://github.com/tedbow/drupal/commit/93c9900cacda6cc63d9415f404f72543...
I pushed out my branch incase I need to reroll this again to at least remind me of what I need to do(or someone else)
Comment #11
tedbowHere is test that confirms updates from the major version 7, in the format 8.x-7.* will recognise that the versions in the format 8.*.* are version in the next major version, major version 8 of a module.
This is the heart of the what I wanted to prove with this issue. The update module can handle an XML file with both legacy, 8.x-*, and semantic versions in the same XML and recognise both major versions.
I am very relieved this works!
Leaving assigned to myself as this patch still need a lot of clean up.
Comment #12
tedbowclean up and refactoring
Comment #13
tedbowMy thoughts on reviewing this patch.
There are a lot of existing problems with
UpdateCoreTestsuch as this example of no docblock. I hope we don't have to fix all these as I would think this would make this issue take a long time.also the XML will have the same problem since they are all copies of existing XML files. I think we can address these in #3110917: [meta] Fix update XML fixtures bad data
Hopefully the script uploaded here will prove we are introducing in new type of problems with the XML.
Comment #14
xjmComment #15
xjmComment #16
dwwStarting a review now...
Comment #17
dwwA lot of this looks good. But it's a huge patch to try to review. I mostly skipped over all the new fixture files.
Not all of these points require work, but I'm setting to NW for at least some of them. ;)
Can we call this semver_test* instead of semantic_test*?
Name could be "Semantic Version Test" if desired.
"Semantic" is true, but not specific enough. We're not testing the semantics of updates. We're testing semver / semantic version.
Hopefully easy to automate this change if it's agreeable.
Really wish we could agree on #3113798: Remove unused (and generally wrong) <tag> markup from Update module test XML fixtures before we add a bazillion more of these bogus tags. :(
Eyes are glazing over trying to carefully review all these fixtures. I see the script that's auto-generating them. I think if I actually look at all this and say anything, it's going to be punted to "out of scope", so I don't really want to spend much energy on it.
That said, the naming conventions for these files are weird. What does "0.0-beta1" mean, given there's an 8.2.0 release in here?
Before we bulk copy/paste all of this, I'd love to do a few cleanups if possible:
#3115435: Make clear why each XML update.module fixture is created the way it is
#3121020: Move Update Manager XML test fixtures into a fixtures/release-history directory
Probably not going to happen, but I can at least wish outloud. ;)
s/UpdateSemanticContribTest/UpdateSemverContribTest/?
This is slightly weird to do in a shared helper method, since it only applies to the contrib side of life. But having different implementations of this in each child class is maybe not worth the effort. Kind of a DRY vs. Smell trade-off. ;)
/shrug
s/install_versions/installed_versions/?
Since it's a potentially error-prone edge case, would love to see some '8.x-8.*' test cases in here, too.
Don't we also need to specify the fixture we're using for core here?I found it later, ignore this.Isn't all this done by refreshUpdateStatus()? Why aren't we just doing the refreshUpdateStatus() inside the loop?
Don't we want a case where an update to a semver release coincides with a required security update?
s/there is update/there is an update/
Then this will need to re-wrap.
This is the key assertion in this whole method. However, it's a bit confusing:
a) I'd expect "8.0.0", not "8.1.0" as the expected release.
b) This looks a lot like a core version string, so it's easy to miss that this is the main thing to be asserting.
Can we add a test case for where all the legacy versions are unsupported and the semver release is recommended?
"The title of the project being tested" or something?
Why do we need 'administer modules' and 'administer themes' for any of this?
Again, I thought all this was the point of refreshUpdateStatus()...
These comments don't fully make sense. What does it mean that an unstable release is available if it's not the latest?
=== ?
The former implies the later. ;)
newline after break;
Isn't this entirely duplicate with the case 0 version of this above? DRY?
Newline after break.
Again -- why do we need these after refreshUpdateStatus()?
That's a lot of Url and Link instantiation inside a deeply nested loop. These never change across the test cases. Can we do this once outside any of the loops and re-use the results inside the assertions? Will also keep these from being 250 chars wide. ;)
"site" seems a bit off. Implies core, but this could be for anything. Maybe "installed_patch_version" or something?
I'd expect a minor version. Oh, I see below, this isn't just "site_patch_version", it's really "installed_minor_patch_versions" or something. #confusing
Would love an inline comment about why we append "-8" to the updateProject name for this. /shrug
YAY! Update manager tests need so much more of this. Thank you, Thank You, THANK YOU!
Aren't all of these filenames wrong for the contrib case? Instead of "drupal" for all these, don't we want (drupal|semver_test) or something to indicate that the fixture name changes depending on who's calling this? Or just "[project_name]..."
Seems like an @todo that these are blank. Maybe something like "Normal" or "Regular" or something so we know we didn't just forget to document them?
Technically "It" would fit on the prior line, although I actually think it's more readable this way...
Same for all these -- "Normal"?
I don't comprehend the naming convention for these array keys. I know it doesn't actually matter, but this is mostly incomprehensible noise at this point.
If this is the best we can hope for, can we have a comment in the docblock for this function to explain what the keys are supposed to imply?
Better yet, can we have more self-documenting keys that guide reviewers and future developers to understanding these?
(Out of scope) I wonder why UpdateTestBase defines its own versions of these constants instead of re-using the ones from Update manager itself. /shrug
s/that only/that the only/
I know we just decided dataProviders are okay in Functional tests at #3113992: The 'Update' page has no idea that some updates are incompatible, but this is *a lot* of cases, and this whole thing happens *twice* (once for core semver, once for contrib semver). I'd be curious to see how many minutes this adds to the test runs, and if we really want to keep going with such a massive dataProvider like this...
Again, "drupal" is only true 1/2 of the time.
This is a slightly weird/unfortunate thing to have to override this method for. Can't we make the semver_test fixtures match the core one or vice-versa?
Ahah! This answers some previous review point. Phew.
"Sets the installed project version"
It's really a "version string", since there can be "extra" and all sorts of non-number stuff...
My mind's capacity is starting to overflow with this review, apologies. But why is it in scope to be adding both of these to UpdateTestBase? Aren't we only using them from children of UpdateSemverTestBase?
Thanks!
-Derek
Comment #18
tedbow@dww thanks for the review. Addressing it now
Comment #19
tedbowAddressing #17
@dww thanks for the review
. I doubt I will get through all of it.
<tag>elements with 1 regex script or other automated method.UpdateSemverTestBase. Removed the conditional added to the above array.$this->assertVersionUpdateLinks('Recommended version:', '8.x-7.1');is not done byrefreshUpdateStatus(), assuming that was just a dreditor errorsecurityUpdateAvailabilityProvider()inUpdateSemverContribTestand add an extra test case for these cases. Since this issue is adding test coverage for existing functionality I wonder we could do this in required also critical follow-up. Just to make this issue easier to review and get committed. I have feeling we could 2 well scoped issues in faster that 1 issue that covers all cases.Added to Remaining tasks either way so it is not forgotten.
This would be changed in #3100115: The update module should recommend updates based on supported_branches rather than major versions majors. I have added a todo here that we should determine if the expectation should change in that issue. I think it is currently agreed upon what the correct behavior should be that case but should definitely look at it that issue, even if we decide this is the correct behavior.
b) Yes I agree this is a little confusing. 1 option would be to change all the
semver_test*.xmlto use not use 8 as the major version it is testing. But then to share code in\Drupal\Tests\update\Functional\UpdateSemverTestBasewe would need class properties$currentMajorand$nextMajorbecause the core and contrib XML would be using different major versions. I think this would make the test methods more unreadable because we would have more string concatenation instead of string literals.Technically the major version should not matter.I personally think adding better comments to
\Drupal\Tests\update\Functional\UpdateSemverContribTestis a better solution.UpdateSemverContribTestthat deal with different types of Legacy -> SemverUpdateCoreTest. This code and almost all the code inUpdateSemverTestBasewas copied directly fromUpdateCoreTest.My hope is that we do not have to fix all the problems that currently exist in 8.9.x
UpdateCoreTestbefore can commit this issue withUpdateSemverTestBase. This is similar to not fixing all the problems with thedrupal*.xmlthat we get because we are doing a straight copy of the XML. I know with the code is different because we don't have script to prove that these are straight copies but comparing the current version of 8.9.xUpdateCoreTestwill show this is the same code.If we do more than just copy the code I also think we risk somehow losing test coverage for something without knowing it.
Ok stopping for now. a lot of the remaining points are covered by response to 15. Interested to see what @dww and others think of this argument.
Sorry the interdiff is huge because of the XML changes.
Comment #20
tedbowHere is an interdiff for 19 without the xml changes
Comment #22
tedbowTalked to @tim.plunkett about the problem I mentioned in #19.15.
He suggested I tried created the diff so that it is more obvious what is being copied. I am working on that. Hopefully it will make it easier to review.
Comment #24
tedbow@dww mentioned this in #17.15 that we didn't need the other permissions.
I am responded that we should leave it because it is copied code. But I had actually changed it locally for testing and forgot to undo.
This is why the test failed.
\Drupal\Tests\update\Functional\UpdateCoreTest::testModulePageRegularUpdate()needs this permission.Reverting that change for now but we should probably move that permission to just that test. I will do in a follow up patch
git diff 8.9.x -C35 > ../3100386-19-C35.patchThe
-C35makes git try harder to find copies. So it no findsThis means that a lot of the problems @dww flagged in #17 won't actually be in the patch as additions. They will be still be in
UpdateSemverTestBase.phpbut git considers them a copy now. So that will make it more clear that a lot of it is existing problems.The patch as
similarity index 39%because there are some functions that didn't get copied to
UpdateSemverTestBase.phpsuch astestClearDiskCache()which doesn't deal directly the core project(and maybe should have been another test anyways)We could move all those types of method to
UpdateSemverTestBase.phpand it won't hurt they don't need to be there. But I am fine doing that if it makes it easier to review.this is because using
-C35make all the XML be recognized as copies now as before git saw them as new files.So this actually makes the patch bigger.
I will include a patch that only includes the
core/modules/update/tests/srcpath to show the code only changes.Comment #25
dwwRe: #19:
1. Thanks, I think that'll be better long term.
2. I already wrote a perl 1-liner to rip out
<tag>in #3113798: Remove unused (and generally wrong) <tag> markup from Update module test XML fixtures. That's not the point. It's just a lot of churn to duplicate all this bogus data and then have to remove it all later. I was stating my preference that we fix that first, since it'd be trivial and easy if only we agreed. But I know it's not going to happen.Since this feature is already released, and we already saw passing test results, what's the hurry? ;) Why rush in 200+ kb of tests and fixtures if they're hard to understand and maintain? Why not spend the effort to make this worth committing, by the standards applied to every other core issue (even critical bugs that have been fixed for weeks but we shipped multiple versions of core with them while we argued about perfect test coverage)?
3. /shrug
4. 👍
5. 👍
6. 👍
7. 👍
8. 👍
9. 👍-- indeed, the
assertVersionUpdateLinks()stuff was a dreditor mis-fire, sorry about that.10. Sure, #NeedsFollowup is fine with me. This patch and issue are already huge.
11. 👍
12a. 👍
12b. Sure, more comments is fine. It's slightly too bad, but pragmatism++ for this. These tests are hard enough to read as-is.
13. 👍
14. 👍
15. See 2 above. ;) I don't know why we'd want to massively expand the footprint of not-so-clearly-written-nor-easy-to-make-sense-of tests in update module. If we're refactoring code into a shared base class and making a bunch of changes so we can test core and contrib with it, why leave known problems broken? But I can rarely make sense of what's in scope when or why, so I give up.
Re: #24:
1. No, a bunch of test methods in
UpdateCoreTestneed 'administer modules'. Search for "admin/modules" and you'll find many hits. I was talking aboutUpdateSemverTestBasenot needing them. Might as well keep those perms for all the tests inUpdateCoreTest, since it'll be a lot of bloat to selectively add it to each test that needs it. /shrug I find it ironic that you set #3113992-93: The 'Update' page has no idea that some updates are incompatible to NW over this exact point, but in this issue you're effectively saying "it was like this already, we're only copying code, and we shouldn't change it or we might break something.". ;)2. Hah. ;) Play git games so the patch doesn't include the weirdness so no one can point it out and it'd be out of scope to fix anything. I'll have to remember this strategy for future issues. 😉
3. -1 to putting more functions in
UpdateSemverTestBasefor the sole reason of keeping the patch here smaller. Again, I think we should be optimizing for the end result code is easy to read and maintain, not the smallest number of bytes we can manage for each patch.4. /shrug
Comment #26
tim.plunkettRe: #24.2 / #25.2
I suggested using -C35 to @tedbow.
No one is playing games here.
The default value is 50%, but lowering the threshold is a common tactic used throughout core development's history.
It's not intended to hide *anything*, but instead to highlight what is actually a change being made by the patch author, instead of obfuscating the intention by placing it among a lot of copy/paste.
Finding the right percentage threshold is conveying *more* information, not less.
Comment #27
tedbowre #25
We have tests here that are not RTBC or committed. So I personally am not 100% sure they are correct(90%?). You have already pointed out some good missing test cases that are not covered by the current test. I am much less confident that those cases are working.
But mostly the problem is any change we make to the update module from now until this is committed has the potential to break this functionality without anyone being aware because this tests are not being run by all other Update module patches. There are also probably cases where other changes to other subsystems could break this functionality(though I can't think of any right now).
Though the Update module is not changing quickly right now, there is always a chance any day that we will find a critical bug(or even security problem) with something else in the update module. In that case we would be forced to make a change to the update module without knowing if we are breaking this functionality. True we could run the tests in the current patch against any issue but that does not give me much confidence.
Finally drupal.org is waiting on this issue to allow Semver for contrib modules(expect for limited modules for testing). This is because this we can't be 100% the update module will work with this. So this another reason we this is critical. Without Semver contrib modules are stuck making
8.x-releases even if they are attempting to make brand new module or a new major version of a module that is only compatible with Drupal 9(because is needs an updated dependency such as Symfony for example)I am not trying to rush this issue in. I just saying that this issue marked as critical for the reasons I just stated.
There are other critical issues for the update module but they are not any of the of ones you mentioned in #17.2 and3. Therefore this is issue should not be delayed on those issues.
I know we are creating more test fixtures that have the same problem as the current test fixtures but we are not making new types of problems and these fixtures can be cleaned up in the same issues.
I am doing that to the best of my ability. I am not trying to loosen standards I am trying to treat this issue as the Critical issue that it is for the reasons I stated in 1)
Comment #28
dwwRe: #27: For the record, I flagged this issue in this week's #d9readiness meeting (although the notes aren't yet posted), asking if it should be critical. That's what prompted @xjm to add comment #15. I agree it's critical, and that's why I'm spending (a lot of) my free time on it. Unlike the rest of you, jumping through these hoops isn't paying any of my bills, it's a labor of "love". I understand the desire to get this in quickly (as I wrote in #6). I just don't understand why some issues (like #3113992: The 'Update' page has no idea that some updates are incompatible) are stalled for weeks on end while we argue about perfect test coverage, while others (like this one) get the "it's cool if the tests are weird and hard to make sense of, something is better than nothing!" treatment. If we were consistent (in either direction), it wouldn't bother me (much), and I'd adapt to our standards. What's causing me to lose my cool is that we're not consistent, so I get the sense that no matter what I do, it's considered out of scope (or not enough, depending on the reviewer), unhelpful, wrong, etc.
Re: #26: So I guess it's now supposed to be on me to re-review the -C35 version and figure out how much of #17 still counts as a legitimate concern vs. off-topic comments on "obfuscated intentions"? Are we done fiddling with the threshold value? Do y'all believe that #24 represents the accurate intentions of the patch author? Is it worth spending time reviewing it yet, or do you want to keep searching for the magic value that properly represents what's reviewable?
Inventing a new issue tag "Adds technical debt" for issues like this where we know we're adding technical debt, but agree it's best due to other considerations. Tagging for "Needs followup" since a lot of #17 is being called out of scope and should be addressed elsewhere. Please define scoped issues you're all happy with so I can spend time fixing things instead of arguing about scope.
Thanks,
-Derek
Comment #29
tedbow@dww if it helps I can go through number #17 again to double check what has been addressed in #24 and comment on what is no longer in the patch because #26 make it clear it is a copy(the lines that are no longer in the patch as additions or deletions at all). I can also fix anything I can that is left from #17 if I missed it in #24. Along with general self review.
UPDATE: To clear, I am currently reviewing #17.
so of it was already fixed, some not fixed and trying to fix now, some already in remain tasks and some I believe is still out of scope. Will post a patch soonish.
Comment #30
tedbowReviewing #17
I do agree that current tags are bogus because even with my argument on that issue the values don't match the values that we have on contribute module XML feeds from drupal.org and they don't match the drupal.org documented API
So yes with the current patch it produces XML that we will have clean up in any case.
So have updated the script I am using to create the XML to have correct
<tag>values. Basicallytagshould always matchversionexcept for dev snapshots.I have also add logic to make
<date>values. This may be overkill but it is easy to do. Just basically starting the release from particular date and minusing about a month for every previous release. I can remove this logic and recreate the xml if wanted.I have added the
create-3100386-semver-xml.phpscript for directly to this patch to make it easier to review and for reviewers to confirm there no XML changes after the script(by deleting the new XML and running the script themselves).Obviously this will have to be remove before RTBC.
#3115435: Make clear why each XML update.module fixture is created the way it is
#3121020: Move Update Manager XML test fixtures into a fixtures/release-history directory
for this.
Agree, This was left over from when it was in UpdateSemverTestBase. Removed the conditional added to the above array.
tldr; I added what I hope is a inline better comment to explain this. Let me know if the comment is enough or needs to improved.
This is all copied code as shown in #24 with further explanation in #26 by @tim.plunkett. I think it fine to not review all the code that is being copied.
Related from @dww in#28
#17 found problems in the code. It seems to fall under, grammar problems, comment improvements, DRY preference, and standards. How should we create follow-ups? Should we create a general follow-up for clean up for all Update tests standards etc? I know these tests are very old so standards have changed and I am sure little problems crept in over the years.
I am not sure if we scope these issues by per-module, per class, or per standards rule on an all core scope.
Yes, git recognizes as a copy it. That being said addressing #17.29 and 37 by change the value need because this further changes to the file. I think 1 reason git does use a lower value as a standard is it is more expensive(I have noticed the diff takes longer) not because it produces an inaccurate diff.
I replace the fixtures in the comments
According this format. I am open for other ideas.
I have also added a class comment explaining this.
My thought on putting these on
UpdateTestBaseinstead ofUpdateSemverTestBasewas that these 2 functions are assertions based on\Drupal\Tests\update\Functional\UpdateTestBase::$updateTableLocatorin the
UpdateTestBase.They have nothing to do with Semver.
These 2 new functions are the corresponding
assertUpdateTable*NotContains()for 2 functions we already have onUpdateTestBaseassertUpdateTableTextContains()andassertUpdateTableElementContains(). Although we are not using the new functions onUpdateContribTest, the only other class that extendsUpdateTestBasebut notUpdateSemverTestBasethese new methods should be used in the future if they need these types of assert on the UPdate rather than inventing it's own. We could move them later but I think that could be easily missed and again the 2 new functions have nothing to do with Semver but are rather dealing with the update table which all classes that extendUpdateTestBasedeal with.I tried to address some of the techinical debt by cleaning up the
taganddateelements in the XML and updating the comments documenting the fixtures to be accurate.As far as the code that was moved from
UpdateCoreTesttoUpdateSemverTestBasein most cases I do not believe this adds to our technical. Although we created a new base class for this issue, would we also consider it new technical debt if we moved a functions with existing problems from 1 existing class to new base class that already existed? If not then I don't think should consider it new technical debt here, if so then yes. I would say no.Of course I know that isn't the exact same same case since we did have to change some things about the code such as assert and use of
$this->updateProjectvs string literal 'drupal'.But I am not removing the tag because I am the author of the patch so far so I don't think that is up to me to decide if it is technical debt or not. Just my opinion.
Comment #32
tedbowAfter ran the create XML script I forgot to update
semver_test.1.0.xmlfor\Drupal\Tests\update\Functional\UpdateSemverContribTest::testUpdatesLegacyToSemverI think did this before. So hacked the xml creating script to add these and do another update.
Comment #33
tedbowComment #34
tedbowAddressing 2 the remaining tasks from test cases @dww suggested in #17
\Drupal\Tests\update\Functional\UpdateSemverContribTest::testUpdatesLegacyToSemver()since this branch might expose bugs around "8" being a major version. see #17.7UpdateSemverContribTestwhere the current major is legacy and unsupported and the next major is semver, supported and recommendedThis requires 2 new XML test files.
Comment #35
tedbowI think this issue getting very big and hard to review, bigger than it needs to be.
I going to change this issue only duplicate the test coverage in
UpdateCoreTestfor contrib.Adding 2 follow-ups
I need to add a 3rd for security release case that is the remaining tasks.
Here is patch that removes
testUpdatesLegacyToSemver()and the xml fixture changes it needed.Comment #37
dwwThis will need a (hopefully trivial) re-roll now that #3121020: Move Update Manager XML test fixtures into a fixtures/release-history directory landed.
Comment #38
jofitzRe-rolled patch from #35 for D9.1.x
Comment #39
dwwA) The PHP fatal error needs help. Probably the base class should move
$modulesto beprotected.B) The patch shouldn't include create-3100386-semver-xml.php
C) The code standard violation for UpdateTestBase.php should be fixed.
Comment #40
narendra.rajwar27Updated patch as mentioned in comment #39
Comment #41
narendra.rajwar27Updated interdiff.txt for comment #40
Comment #42
narendra.rajwar27Comment #44
pasqualleComment #45
xjmCleaning up pre-9.0.0 beta targets.
Test issues are patch-eligible.
Comment #47
daffie commentedComment #48
daffie commentedComment #49
ravi.shankar commentedAdded reroll of patch #40 on D-9.1.x
Comment #50
daffie commented@ravi.shankar: There is something wrong with your rerolled patch. The original has a size of 218kb and your patch is 168kb. It also needs to be rerolled against 9.2.x.
Comment #51
xjmRemoving credit for the problematic reroll. If you need assistance with how to reroll patches, you can reach out in the Drupal community Slack. Thanks!
Comment #52
ravi.shankar commentedThanks @daffie
Here I have again added a reroll, please review.
Comment #53
ravi.shankar commentedTrying to fix testbot issues of patch #52
Comment #54
daffie commentedPatch is still failing the testbot.
Comment #55
ravi.shankar commentedFixing failed tests.
Comment #56
ravi.shankar commentedFixing failed tests of patch #55.
Comment #57
nikitagupta commentedComment #58
daffie commentedJust a couple of nitpicks:
A better class name would be
UpdateSemverCoreTestas we are extending the classUpdateSemverTestBase.Could we not translate the text string or any other text string in this file. It happen multiple times in this class.
Could this method be placed directly after the method
assertUpdateTableTextContains()as the two method belong together.@nikitagupta: Thank you for the reroll.
Comment #59
nikitagupta commentedComment #60
daffie commentedComment #61
daffie commented@nikitagupta: Thank you for fixing the patch!
The patch does what the proposed solution from the IS is saying that should be done.
All code changes look goo to me.
For me it is RTBC.
Comment #62
ilgnerfagundes commentedI reviewed the patch again, and it looks all right. RTBC +1
Comment #63
alexpott@ilgnerfagundes I'm seeing quite a few single line comments where you are attaching a screenshot that provides no additional info beyond what the bot / dreditor / gitlab already gives us. So, I've removed the issue credit for that screenshot. In the future, you can get credit for issues by reading the issue to understand its purpose, and posting your review or testing of that purpose. Thank you!
Comment #64
alexpottThese tests are being removed by the patch with no obvious replacement. I've searched the issue for most of these tests and I can't see any reasons why they are being removed - only comments which say we need to decide where to put them (eg. testSecurityCoverageMessage). Either the issue summary needs updating to explain why they're not necessary anymore or we should add them to \Drupal\Tests\update\Functional\UpdateSemverCoreTest (or somewhere else).
Comment #65
ilgnerfagundes commentedHello guys, I put the methods mentioned in comment # 64 and I'm uploading the patch, but I don't know how I do it to test it.
Comment #66
daffie commented@Ilgner: Please adjust this patch according to @alexpott in comment #64.
Comment #67
ilgnerfagundes commentedsorry, i had done the wrong patch, i'm sending the new patch
Comment #68
ilgnerfagundes commentedComment #69
ravi.shankar commentedFixed custom commands issues of patch #67.
Comment #71
vsujeetkumar commentedFixing tests.
Comment #73
vsujeetkumar commentedComment #76
phenaproximaAt @tedbow's behest, I just "rerolled" patch #35 into the new merge request !465. I didn't make any changes beyond resolving the conflicts (and fixing coding standards violations so that the tests would run).
In doing so, I discovered the answer to @alexpott's question in #64: the test methods are not being removed; they are simply moved wholesale out of UpdateSemverTestBase and into UpdateCoreTest.
We still need to reapply @daffie's feedback in #58 to return this to RTBC, so I'm assigning this to @tedbow in order to complete it. Since this was very close to a straight-up reroll, hopefully I will still be within issue queue etiquette if I restore RTBC once that's done.
Comment #77
tedbowComment #78
tedbowforgot to add the diff
Comment #79
tedbowLooking at the diff in #78 I realized we did want a couple of the changes
Here is a new diff
Comment #80
tedbowThis explains the difference between #78 and current MR branch. So stuff probably just got mixed up in the many rerolls
These are all the same in `UpdateSemverTestBase` so we don't need them here
This is in the base class so doesn't need to be duplicated here.
whitespace error from me. I fixed this.
These 2 functions did the same thing. Added `setProjectInstalledVersion` so it could be used with the contrib project also and the name is clear what we are doing in relation to the test project.
Also calling the 1 that works with contrib and core now.
This method does not take a 2nd argument. This was left over from when were calling
assertRaw()which no longer works because we have to assert on the specific table for core or contrib.Unrelated changes. This is not in 9.2.x and doesn't involve the change we are making here.
Previous comment broke the file name across 2 lines
Unneeded period
Comment #81
tedbowre #64 these methods don't actually have to do with semver test for the core project. They were just in the original UpdateCoreTest. See the follow-up #3127177: Move test methods not directly related to updates for the Drupal project into their own class
Comment #82
tedbowNeeds follow up was added in #28 because of unaddressed items in #17. I am looking over that to see what is left.
follow-upsfrom #17
$this->checkForMetaRefresh();. This was existing code that was being copied but I checked 9.2.x and this branch and removing these calls will fail the test.Comment #83
phenaproximaOK, everything looks good here. The merge request is green, and it appears all feedback is addressed and follow-ups are filed. I say we've done enough iterating. Since my work on this was just a straight-up reroll (and two minor coding standards fixes required to get tests to run), I feel okay re-RTBCing it.
Comment #85
alexpottCommitted and pushed 27070f4c91 to 9.3.x and a1822890bf to 9.2.x. Thanks!
The random xml indentation bugs me but it seems like all of the update xml has this so no reason to hold up this one.