Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Part of #1696224: Remove system_settings_form()
simpletest_settings_form uses system_settings_form() and needs to use system_config_form().
Comment | File | Size | Author |
---|---|---|---|
#60 | drupal8.config-simpletest.60.patch | 358 bytes | dagmar |
#56 | drupal8.config-simpletest.56.patch | 12.66 KB | sun |
#45 | 1705748-simpletest-config.patch | 13 KB | boombatower |
#39 | drupal8.config-simpletest.39.patch | 14.5 KB | sun |
#38 | interdiff.txt | 700 bytes | tim.plunkett |
Comments
Comment #1
sunTagging.
Comment #2
n3or CreditAttribution: n3or commentedAssignment.
Comment #3
n3or CreditAttribution: n3or commentedFirst version. Tried to adjust naming to the conventions, converted the admin form, created the yml-file and the upgrade path.
Comment #4
sunAwesome! :)
In YAML, all values are strings by default, so strings do not need any special treatment.
However, integers, numbers and any other special values need to be wrapped in single-quotes ('').
Likewise, empty strings need to be explicitly specified as such; i.e.: ''
This value should be an empty string.
All configuration objects of a module are automatically deleted upon uninstallation. These lines need to be removed entirely instead. :)
ugh :) Please check the patch in http://drupal.org/node/1496458#comment-6285700 for how this should look like ;)
The variable can be renamed to just $config, since this is the settings form of Simpletest module, so there's naturally no other $config involved.
Lastly, it's possible that we might miss some instances in core/scripts/run-tests.sh -- or did you check that already?
Comment #5
n3or CreditAttribution: n3or commentedFixed problems mentioned in comment #4. Thank you!
Comment #6
n3or CreditAttribution: n3or commentedComment #7
sunoh, sorry, I completely overlooked a blatant mistake here -- every dot in a key is transformed into a nested array key in the .yml file. I.e., this needs to look like this:
We most likely need to cast the value of httpauth.method into an integer like this:
That is, because the value 1 refers to the cURL constant value CURLAUTH_BASIC, and cURL won't know what to do with a '1' (string).
We're still missing the phpDoc for this function :)
The variables are migrated into the wrong config object! ;)
Variable mismatch! :)
Comment #8
n3or CreditAttribution: n3or commentedProblems mentioned in comment #7 fixed.
Comment #9
n3or CreditAttribution: n3or commented4 spaces instead of 2 spaces in yml-file.
Comment #11
sunWe're missing a ->save() here. :)
Comment #12
n3or CreditAttribution: n3or commentedProblem mentioned in #11 fixed and changed a comment related to simpletest_parent_profile.
Comment #13
n3or CreditAttribution: n3or commentedForgot to change issue status.
Comment #15
sunI don't see what's wrong with this patch.
Most likely, the test failures are caused by the change to drupal_system_listing(), which in turn means that also this patch is blocked on #1704196: Remove Config's dependencies on procedural Drupal code in includes/common.inc - which will hopefully land very soon.
Comment #16
aspilicious CreditAttribution: aspilicious commented#13: config-simpletest.12.patch queued for re-testing.
Comment #18
n3or CreditAttribution: n3or commentedProblem fixed by using "maximum_redirects" as property of TestBase and not of config object. Thanks to @sun for his support!
Additionally added missing comma in simpletest.install.
Comment #19
sunWe already have that config object in $simpletest_config here? :)
Comment #20
alexpottCouple of minor nitpicks...
Need to add @see simpletest_settings_form_submit()
The @ingroup forms here is unnecessary. It's for functions that produce form arrays not submission handlers
Comment #21
alexpottCrosspost...
Comment #22
n3or CreditAttribution: n3or commentedYou're absolutely right!
Comment #23
n3or CreditAttribution: n3or commentedMissing changes of #21!
Comment #24
n3or CreditAttribution: n3or commentedFixed problems mentioned in #20
Comment #25
sunYay! :)
This patch is RTBC...
...however, the additionally required fix for maximumRedirects also applies to the verbose setting, which makes this super-nice patch blocked by #1611430: Verbose debug output in unit tests relies on the database
That is, because the config() in simpletest_verbose() will effectively try to read the verbose setting from the simpletest.settings config file of the "site under test" --- but that environment might not even have Simpletest module installed.
Essentially, this requires the very same change as for maximumRedirects - but that ain't possible, as long as TestBase calls into a completely detached procedural simpletest_verbose() function, which is not able to access the test class' properties anymore.
Comment #26
aspilicious CreditAttribution: aspilicious commented#24: config-simpletest.24.patch queued for re-testing.
Comment #28
n3or CreditAttribution: n3or commentedFixed incompatibility to current D8 core. In my opinion attached interdiff doesn't make sense, I attached it though.
Comment #29
sunAwesome!!! :)
Comment #30
n3or CreditAttribution: n3or commentedWrong component.
Comment #31
no_commit_credit CreditAttribution: no_commit_credit commentedMinor style fix attached. Per http://drupal.org/node/1354#hookimpl, update hooks get the imperative (the summaries are user-facing).
Comment #33
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks.
Comment #34
xjmThis issue causes #1717868: PIFR uses variable_get() but needs config() in Drupal 8 (note how the patches above have 0 passes). I left a message asking webchick to
git revert 490386f
and reopen this issue if a solution for that other issue is not straightforward, because no tests are running for any projects since this was committed.If that issue is resolved, we can set the status of this one back without reverting.
Comment #35
webchickReverted this patch for now using the command in #34. Reverting status.
Comment #36
webchickAlmost.
Comment #37
tim.plunkettOn a hunch, let's see what these results are.
Comment #38
tim.plunkettForgot an interdiff, here's a cheap one.
The results prove my theory, that these simpletest variables are responsible for the results persisting long enough for testbot to display results.
Comment #39
sunAttached patch requires PIFR to invoke simpletest with
--keep-results
Comment #40
tim.plunkettSplit this out into #1719530: Add --keep-results flag to run-tests.sh so it can be committed without breaking core.
Comment #41
boombatower CreditAttribution: boombatower commented#31: simpletest-1705748-31.patch queued for re-testing.
Comment #42
boombatower CreditAttribution: boombatower commentedTesting out to see if a patched testbot will detect this fun edge-case since humans seem to miss the 0.
http://drupal.org/node/873496#comment-6332732
Comment #43
boombatower CreditAttribution: boombatower commentedCheck out #31 vs #28! Fix http://drupal.org/node/873496#comment-6332868. Looking for feedback on the repercussions.
Comment #44
boombatower CreditAttribution: boombatower commentedComment #45
boombatower CreditAttribution: boombatower commentedNow that #1719530: Add --keep-results flag to run-tests.sh made it in, I have patch a pifr bot in advance, and rerolled this patch.
Comment #46
boombatower CreditAttribution: boombatower commentedNote that I didn't have the pifr patch to catch the 0 results applied...only the patch to add flag when calling run-tests.sh...so it seems either run-tests.sh patch does not work of pifr patch does not.
Comment #47
boombatower CreditAttribution: boombatower commented#45: 1705748-simpletest-config.patch queued for re-testing.
EDIT: flag patch fix was committed.
EDIT: Looks like someone broke my pifr code that allows me to disable a bot running a test so it won't ask for another...i'll have to retest again.
EDIT: tested on patch client and you will see my patch returned proper results.
EDIT: Hold off on committing until we can push to all testbots. #1723044: I no longer have access to update testbots
Comment #48
n3or CreditAttribution: n3or commented#45: 1705748-simpletest-config.patch queued for re-testing.
Comment #49
sun#45: 1705748-simpletest-config.patch queued for re-testing.
Comment #50
boombatower CreditAttribution: boombatower commentedIt ran run-tests.sh with new flag properly, from log:
So looks like we should be able to commit this safely now. Along with that deployment is the one to catch crud like this in the future so we hopefully can stop having these sorts of rare issues.
Comment #51
sunThanks.
Comment #52
boombatower CreditAttribution: boombatower commentedActually, before we jump too fast. Based on your comment http://drupal.org/node/1717868#comment-6422150 I looked into the --verbose flag which I remember existing, but not to replace the simpletest_verbose variable.
Which is intended to spit out the individual row-by-row messages (assertions) in the output of the run-tests.sh script. Which is quite different from the simpletest_verbose variable which was to control the verbose page capturing functionality in DrupalWebTestCase.
We probably want to split these out and rename one. May also want to default to false on the command line? dunno.
I think --verbose flag as it stand now works the way that is most consistent with other scripts and makes sense. Perhaps we rename simpletest_verbose variable to 'capture' or something along those lines to 'capture browser shot' etc. I don't like those names just providing a thought basis.
If we default cli to false then using the cli then might do.
--print-details --verbose
--print-details to print out assertion messages
--print-results
--results
--details
,etc
Comment #53
sun@boombatower: Let's move that discussion on --verbose into a separate issue. This patch here doesn't actually influence that, as it doesn't touch run-tests.sh and so on at all.
I wonder whether maximum redirects is actually supposed to be configuration...?
For one, there's at least one test that overrides it, so it appears to be test-case-specific setting/property.
The only other usage is within WebTestBase's internal browser.
In turn, this means that you cannot actually configure this... if you'd configure it to e.g. 0, then surely some tests will fail, because the internal browser would not follow redirects anymore.
Even more interesting is the @todo about it being potentially obsolete for D8, since cURL itself was fixed.
So I guess we want to remove this from the configuration and just turn it into a regular class property.
This variable actually does not exist on a regular Drupal site, but only within a test run.
Let's delete it from the default config file and also from the update function.
Comment #54
sunAdditionally, let's make sure to remove the stop-gap fix to run-tests.sh that's going to be added in #1719530-15: Add --keep-results flag to run-tests.sh
Comment #55
boombatower CreditAttribution: boombatower commentedWhen I referred to flag it was from your comment in http://drupal.org/node/1717868#comment-6422150, which would seem to imply the testbot should be using the --verbose flag, yet then you had "(non-existing)" which I am not sure if that referred to not adding one for the old setting or what since we do have a flag it just doesn't related to what is being changed.
Since we have the temporary hack from the other issue placing the --verbose discussion in another issue is fine, but without that it definitely needed to be solved in this issue along with the --keep-results shift.
Created #1774002: Correct mistake introduced in simpletest cmi conversion by introducing --verbose-browser flag
Comment #56
sunAdjusted for #53 and also removed the stop-gap fix from run-tests.sh, which is no longer needed with this patch.
Comment #57
boombatower CreditAttribution: boombatower commentedWhy remove the stop gap measure now since it will simple return to being enabled on the testbot until we resolve and commit #1774002: Correct mistake introduced in simpletest cmi conversion by introducing --verbose-browser flag which seemed to be your preference to split into another issue?
Comment #58
sun@boombatower: The testbot already adheres to the converted configuration, as you can see in the test results for the patch in #56: http://qa.drupal.org/pifr/test/332313
The separate
--verbose-browser
option (as proposed in #1774002: Correct mistake introduced in simpletest cmi conversion by introducing --verbose-browser flag) is not relevant for this conversion issue.Comment #59
webchickRight; the workaround was for these settings not being converted to CMI yet; I don't think it has bearing on #1774002: Correct mistake introduced in simpletest cmi conversion by introducing --verbose-browser flag.
Ok, here we go. Second time's a charm? :)
Committed and pushed to 8.x. Thanks!
Comment #60
dagmarI think the yml file was not committed.
Comment #61
webchick*blush*
Committed/pushed to 8.x. Thanks. :P
Comment #62
boombatower CreditAttribution: boombatower commentedso yea, I tested/committed/wrote the stuff to make the testbot "convert to cmi" it isn't convert it to cmi...we decided to change to flags instead of setting the configuration directly like testbot did before... unfortunately we did not add a flag to turn off verbose test output and the default remains enabled...so the testbot should now be testing with verbose browser output.
Which is why it seemed logical to either a) include the --verbrose-browser flag in this patch, or before this patch (like with --keep-results), or b) leave the temporary hack in. Whereas now we are just back to a broken implementation.
Comment #63
boombatower CreditAttribution: boombatower commentedThe patch for adding --keep-results http://drupal.org/node/1719530#comment-6326150 also subtly change simpletest_verbose to be set from --verbose flag and failed to update the documentation. So given that I looked at the code before, documentation, and intentent this does not behave the way it was documented. We can resolve the documentation in the other issue for --verbose-browser if we choose to change or just fix doc.
So this issue is fine due to the changes made in --keep-results (doesn't just add keep results flag).