If this UI is going to make it into Drupal core, it needs tests.
| Comment | File | Size | Author |
|---|---|---|---|
| #40 | 2647470.35.patch | 11.76 KB | xjm |
| #36 | 35-36-interdiff.txt | 2.18 KB | abhishek-anand |
| #36 | 2647470.36.patch | 12.94 KB | abhishek-anand |
| #35 | 30-35-interdiff.txt | 641 bytes | alexpott |
| #35 | 2647470.35.patch | 11.76 KB | alexpott |
Comments
Comment #2
abhishek-anand commentedComment #3
gábor hojtsySounds like a migrate critical?
Comment #4
abhishek-anand commentedThere are two tests that needs to be written for this:
1) WebTest to check all the states of the upgrade form
2) UnitTest for testing the migration trait.
Patch for the WebTest is attached. Its WIP
Comment #5
xjmMarking NR since there is a patch.
Comment #6
abhishek-anand commentedAnother patch, still WIP
Comment #7
alexpottSo the
d6_useris migrating a user that replaces the user the test creates and that user does not have permissions to run the batch :)If we don't create the user and just log on as the test user everything works.
Comment #8
alexpottComment #10
alexpottFixing test
Comment #11
alexpottWith patch :( d.o is behaving very weird for me.
Comment #13
alexpottFixing D7 test and postgres... can't get sqlite to work yet.
Comment #14
alexpottIn order to get sqlite to pass we need to fix #2675000: SQLBase::mapjoinable does not support SQLite part 2
Patch attached cleans everything up a bit.
Comment #15
alexpottBit of a head scratcher... something is fragile in Postgres prefixing... anyhow this fixes it so with #2675000: SQLBase::mapjoinable does not support SQLite part 2 we have green on all dbs!
Comment #16
xjmThis comment sounds like it's saying that the code in the patch does not work. If it does work, can we rewrite the comment to describe the current code rather than what doesn't work?
Hm, where are these fields set to required in the first place? Wouldn't it be better to just change them to not required wherever that is, rather than overriding it? It wouldn't be coming from the parent form in this case.
I think it would be better to have an @todo and followup issue to figure out how to make
#limit_validation_errorswork rather than commenting out the code. That would also help explain the disabled requirement on the fields.Comment #17
xjmNit: Extra blank line.
This should be something like "Provides a base class for testing migration upgrades in the UI."
I guess this should also be removed?
Are we sure we want this to be private?
I don't understand why this comment means this line, or for that matter why 7-character prefixes at most means it can't cause collisions.
These are missing the one-line summary. Reference: https://www.drupal.org/node/1354#drupal
I see we are also using the pattern here of having the test method on the base class so that it is executed for all child classes. It's worth adding a note to the class docblocks indicating that the test executes test methods from the base class.
Comment #18
xjmI requeued the tests now that #2675000: SQLBase::mapjoinable does not support SQLite part 2 is in 8.1.x.
Comment #19
xjmHuh, it looks like SQLite is still failing. :(
Comment #20
mikeryanComment #21
mikeryanJust for laughs, requeued SQLite with PHP7...
Comment #24
alexpottThe sqlite change didn't get pushed... it has been now - requeued the tests
Comment #25
alexpottAddressed all the points in #16 and #17 with fixes to comments and code. Re #16
Nope. The database settings form is from core - so that is not possible.
Comment #26
alexpottWe still have a problem... adding tests with
is very far from ideal.
Comment #27
alexpottIn order to fix it we would have to add the following keys to core migration schema...
However at least for the
database_state_keyI'm not convinced that this is correct path to go down.Comment #28
alexpottI've created #2678564: A missing schema to support migrate UI - source_base_path and database_state_key for the file schema.
Comment #29
alexpottSo actually both are missing schema - so #2678564: A missing schema to support migrate UI - source_base_path and database_state_key will fix both.
Comment #30
alexpottI can't think of any decent way of really really testing the migrations - but at the very least we can count all of the entities. It is better than nothing.
Comment #31
xjm#2678564: A missing schema to support migrate UI - source_base_path and database_state_key is in now.
Comment #32
xjmSo do we remove this now?
Comment #33
xjmOther than that outstanding thing, I think this patch provides sufficient test coverage for the initial alpha. The counts are definitely an improvement.
Comment #34
gábor hojtsyLet's remove the turning off strict schema checking.
Comment #35
alexpottComment #36
abhishek-anand commentedWe also need tests for the rollback process. I have written some code for the same, but the tests are failing. Looks like the rollback is not clean.
Comment #38
alexpott@abhishek-anand I'd be tempted to but rollback testing into a followup.
Comment #39
xjmYeah, I think let's put the rollback tests in a followup issue.
Comment #40
xjmI added @abhishek-anand's start at rollback tests in #2678994: Write tests for rollback. Reuploading the earlier patch which is RTBC if postgres doesn't fail again.
Comment #42
xjmThe test runs have actually completed on DrupalCI, just not updated on d.o. The postgres fail is a known/recurring DrupalCI issue, so I committed and pushed this to 8.x-1.x. We will have another chance to test it with the core patch, also.