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.
Berdir found that most of Views time was spent installing the 40+ default views for each method.
This introduces a $testViews property, similar to $modules, which specifies the testing Views that must be available for that class.
This is a work-in-progress
Comment | File | Size | Author |
---|---|---|---|
#5 | vdc-1856272-5.patch | 134.1 KB | tim.plunkett |
#2 | vdc-1847588-8.patch | 136.72 KB | tim.plunkett |
Comments
Comment #1
Grayside CreditAttribution: Grayside commentedShouldn't this be generic across configurables? What makes Views super unique?
Comment #2
tim.plunkettI had to start somewhere. Also, there are 70 testing views and 6 other testing config entities.
I meant to post this last night, whoops.
And yes, too much of this is hardcoded, but as I said, WIP.
Comment #3
tim.plunkettGrr, I thought I left out the unrelated changes like this. I'll remove them once I see what the bot does.
Comment #5
tim.plunkettOkay, here it is.
Comment #6
tim.plunkettComment #7
tim.plunkett8.x branch tests are taking around 55-66 minutes depending on the bot, the last run on bot #958 being 66 minutes.
This running on #659 took 44 minutes, I'm going to retest to confirm.
Comment #8
xjmComment #9
tim.plunkettOkay, the 9XX bots have always been slower, so this is a more accurate comparison with the 66 minute 8.x run:
Bot #983, 49 minutes.
Comment #10
dawehner< 3
yeah!
This makes it's also way easier to read.
There is some conspiracy going on.
You seemed to have changed every instance of it, so cool!
It's a good question whether testing for previous bugs should be part of the tests or not, but personally i would vote for yes, as it doesn't cost us much.
I had some similar code before (using the container in the test enviroment) and wasn't sure whether $this->container/drupal_container() is the right one to use, but for sure just the second one works without issues.
Should we use the 'views.view' prefix here already? Technically it doesn't change but it might make it easier to get the code.
Comment #11
tim.plunkettI forgot about $this->container, I was just copying code out of config.inc
Also, I tried to not make it too Views specific, see comment #1
I'm not comfortable with RTBC yet until heyrocker or alexpott looks at this.
Comment #12
gddThis seems OK to me, especially in the context of test optimization. It would be nice if we could figure out a way to actually use config_sync_get_changes() to generate the list, but it doesn't really make sense given what we're trying to do. There was one minor little thing in the code I wondered about.
Not sure I get the point of the array_merge() here since you hardcode $views to be an empty array above? Seems like you could just as easily do $views = $class::$textViews.
Comment #13
tim.plunkettThat trick is borrowed from WebTestBase::setUp() for enabling modules.
The idea is that both a specific test view and its base class can specify views to use. We're not using that here yet, because I didn't look try to deduce any patterns like that.
Comment #14
tim.plunkettIf heyrocker was okay with the config import part, then I'm not worried now and I'm restoring to RTBC from #10.
Comment #15
xjmHaven't reviewed this myself, but just wanted to note that I added the underscore-prefixed method names to #1856630: [Change notice] [META] Rename Views methods to core standards, in case those raise any committer eyebrows.
Comment #16
catchLooks good to me. Committed/pushed to 8.x. Does this need a change notice for Views contrib test writers?
Comment #17
xjmChange notifications have not been written for much larger API changes than this. I did try to introduce the idea, but...
http://drupal.org/list-changes/views
Comment #18
catchI guess we could file the change notice issues against views module in contrib..
Comment #19
xjmComment #20
xjmSo, I talked about this in IRC with berdir, webchick, etc. in IRC. Let's called this fixed, because we're changing how we do something that's new to D8 Views tests anyway. However, in general, we probably should come up with some change notifications for Views API changes, and henceforth let's set the issue back to active, tag for change notification, but not mark it critical, since it's a contrib API change rather than a core one. We can always decide we don't need a change notification for something.