welcome to net camp this talk is about PR environments for workflow for
developing Drupal sites it's specifically about doing it on dead shot
but basically a PR environments is a big hot topic everyone's kind of doing it in different ways really is about best
practices right so how many people here are already doing like branching get branching almost everybody is everybody
doing like automatic pull requests environments yet or they tried so you
basically know the idea though right like I've found Wikipedia DTaP we call
DevOps but it's like been around awhile DTaP yeah that's the other maybe that's why we don't call it DTaP anymore but
you know this whole process of like to put your software somewhere and test it has been around a while if we call it
DevOps now in our world but you know we kind of know some of this so I put this
in for some talks because the audience is a little less technical but you get
the idea right you push to Deb you try it out a little bit but you really push it again to another environment let someone else try it out make sure it
really works they accepted that it is working and then you're really saying ok you accepted it I go to production so
you know a lot of our DevOps stuff started out like this you know and then
eventually you realize ok we need at least a copy of that somewhere this is going back like before we had all these
platforms as a service you would get like your website person would have to manage your server and maybe they'd copy
files up and break it so like ok one day let's get a dev site they do that maybe eventually they get Jenkins maybe some
of you are familiar with this screen it's like the de-facto DevOps tool you
know that people think you need for everything eventually you get these like products come about you know in this is
aqua cloud environment so that's but that's good devtest large stage broad
whatever you know different words for the same thing are a for release and you
know fear what the a stands for but point is it's like getting environment you want copies of your websites running so you
can build it without breaking the one the people actually looking at remote admin slide all these different ways to
kind of do this so always use dev and test and go to production is what we always say in the professional drupal
world but you know don't forget happy add to that make sure dev and test are up-to-date like Devon test o could be
anything put some other website there you want it to right so actually it's not really proving that it works if it's
not the actual latest version of your website on the latest version of your website on test and that means like
always destroy you're just drawing down a de Tory test and you're telling me that's what I'm supposed to do but wait I was working on that oops I destroyed
my whole site building I was working on for days or weeks so even with this dev
test live it's kind of difficult it can be difficult because you still are it's up to you to kind of copy the database there and make sure you didn't blow away
what you were working on all that other stuff so yeah I need to add one more
person in the team and it becomes a whole nother mess where you're like your whole team gets stalled because you're like I don't want to touch that I'm
scared just like what Jeff is talking about how many people are in the keynote everybody yeah it's exactly the same
stuff because it's it's not linear even if you're doing yourself you should
branch your code so you should brace your environments too and that's kind of how we roll now we don't really use dev test live we use just master in
production and in every environments PR so everybody and github this you know
you know kind of familiar with the police to you whether it's hit lab the same kind of thing merge request you
create a PR you clone it somehow to another URL so people can look at it
hopefully you have some kind of test running the pass or fail the developer gets notification that's an important
part of DevOps they actually see that they got a failure and they keep working until it passed right so they push again it rebuilds until the test pass when
they do eventually hopefully a human looks at it for a second at least they click yeah it's okay they click
merge and they release right so if with this flow like you're you're working on
one feature one developer until it's done you're not like hammering it all down as one pipeline all at the same
time you can have like a complicated feature going for however long it takes and then crank out fast ones and release
them almost immediately style changes for example if you're not in the dev test pipeline you just do a quick pull
request change the color and off your coats and you have to worry about deploying bad code or in progress stuff
so yeah you can get this done with Jenkins you know you Jenkins is just a task runner just runs whatever you put
into it so you still have to write scripts you still have to do stuff there's lots of plugins and things and you can wire up all sorts of crazy great
CI but this is the UI you get this is what they gave you okay screenshots a little holds true it's a little better
now the pollution stuff looks really good but it's still like a lot of it's on you the maintenance is on you this isn't like a project developer centric design
tool so but eventually like the workflow was clear so this is our James
Stansbury's little script this is what eventually became tugboat so that he works for a lot of bots they do a lot
they do lots of DevOps back then they actually set this up for I think and we see was at the time the client is their
Jenkins script to build a pull request to build an environment from a pull request so they were able to write this
and use it for every project so is the first steps and kind of getting there you know getting to this reusable process where you know I'm manually
setting up your Jenkins every time so Matt and Jeff Lola around this time told
me about this I was like that's a great idea or they they said this you should put this maybe that's something you could put into your product and that's
basically what I did so def shop existed already but we were just doing manual environments where you can choose this
one on this branch but to trigger the cycle of automatically creating one that was just like a lightning bolt moment
and I also realized deaf shop is a Drupal site so I have the web hook receiver right there I'm already getting
the web hook can give up to trigger the get poles all I gotta do is detect the PR and the PR payload tells me that
branch and I need every everything I need to know is there so a little couple modules later and I was able to set up
the Clos request workflow that we were all imagining so this is like what the home page looks
like when you first start with no projects and I'm just from there we're just gonna dive in and make some stuff
so I'm gonna bore you with slides I thought we did I I kind of do this all the time so we're gonna go and kind of
demonstrate in real time and go live so mm-hmm drop something that has provided a
service where you write yes it's open source so you can run it yourself but we are basically we've been providing
support for service for a long time and we're about to start selling you a whole server as Deb shot cloud cloud service
so come talk to us immediately after the talk if you want but it's also open
source because so that we can install it behind people's data center firewalls and special places it's a basic lamp
stack so it integrates well with existing IT people or teams that want to use their existing puppet and user
authentication and it's good for them so at the same time people developers they
just want to push a button and get it going so we're working out how to support all of that as a business
all right so Drupal composer project
right this is the new thing that everyone's building out us this is a standard way to make a Drupal site based
on composer it actually works for a seven and eight so don't think you need just have to use
eight to use composer it's not terribly documented well but this is all it is is another branch so if you switch to this
seven point X branch you can see this create project seven point next step
instead eight right this works great in
general we made up we forked in tomato a better one so the Deaf shop composer
template chrome doesn't
if you google it it shows up on packages on github and it has a couple extra
bonus things in it primarily it adds a test folder that
works out of the box so you run a composer create project you go to the test folder you're on bin 2 hat and it
actually runs the passing test it's spitting out all that the hatten standard so if you've gone to other perhaps sessions or you've never done it
before the set up is still really manual the document is set up it's like put this composer JSON file in it then
search for this ad yeah I'm looking fig copy and paste it in there you you literally google it even if you're an expert because the thing doesn't have it
default in it so we recently built code to make it all just works this is we're going to do right now to start a brand
new project and we're gonna create a repo now so
it's ready for us
public so
this composer create project basically just copies this thing into your directory but it's a great base for
launching Drupal sites so just call it net camp
[Music]
and you know those are always takes while with these dependency things but it scaffolds everything you need in
there and then you can basically start building it right away deaf shop has built and composer install so it sees the composer desi files and
just runs it so we don't have to do any extra residue any extra script writing or or llamo config in this in this
session one of the other things we do is
you see that right there it says running composer install in the tests folder so we went ahead and wired up the root
composer installed runs composer installed in the test folder because when you're running the Hat that's what
you do make a separate composer app basically composer Jason and you're expected to not only to run been to hack
but make sure you run composer install in there too for you before it run so we're trying to automate everything we could possibly automate here and that's
it so now we have this new folder go to net camp and there's Drupal so those web
there's everything we need so we're going to add it to this repo
all that stuff
all right so now a pull request for master on master for the first pitch
that's all full well in the future you'll see when you couldn't be branch get up now tells you click here to clean up or quest will do that like cuz this
is brand new so so there's when a repo
God read me I can edit that later I can now just take this directly and go straight away and start plugging it into
the archer port our deaf shops so this
is our deaf shop that posts our actual website for deaf Shep stock support I got some other sites on here mostly for
demo purposes but basically we try to surface all the info you need on one spot so this is the project code name it
is the actual URL so if you click that it goes straight to our site I'm already
logged in so it doesn't look like what it would look like for you see our version of Drupal so we'll hold and we
see all these versions these requests here if I click the project name goes in and I have a dashboard and call it
thanks so the get URL for easy copy paste a little drop down for branches this link to github goes straight back
to the git repo for convenience as well does it only work give up any git repo
technically advanced API integration with github get lab or get get loving
bitbucket now and the get lab is in a pull request already so someone here
we're gonna work on it but basically ill don't receive any web hook and just pull on all the environments if it doesn't
know what branch it's just a dumb web hook like you could even use our your kind of hooks or something just to any
any web ping to that URL well technically just pull all the environments that are on branches but
when it's github it knows the branch so it just runs that one and we just added I get the good lab detects that one soon
anyway so each block represents a site this is our live site it shows that's just the name of the
environment this is what branch of tag it's on what version of Drupal is running we can click here to see the
Apache errors so surface that you can add all you know multiple domain name
this is basically it's how you go live so DEFCON works by automatically creating the domain name from the
environment name dot base domain and there's lots of my buttons but this is
I'm getting weary quitting a new project right we kind of never really wanted to give you just a quick background but how
are we gonna start a new project alright so ok start a new project Ned
camp taste in the gate URL so everything
runs as the eager user on this server so we tell you you know this is how y sh a
and mikey has already uploaded so but we put it in this little form here so you can easily copy it out copy it out and
put it in your github account so that this user can access this repo
click Next there's a big forum here so we hope to kind of add pre clone and
analyze the pre populate this stuff but basically if we using composing a
project the path to Drupal is web it used to be like Dockery if it's not we a repo or something and leave a blank
it'll also work with just a regular quarry car so it's flexible doesn't care
this setting is not normally visible but it's an option so you can check a box and say like I want to customize it to
match the domain I'm working on or something deploy hooks are built right in so you don't have to configure yamo a write
script so you can just check a box a every time the code deploys I want to do these things you can have a hook CML
file if you want to it'll lock each environment so like if someone's
deploying to their Deb it'll force them to use the hooks or you can let them check a box each time with these things
and also run tests kicks off the bat tests something was playing soon so you got
like an important configuration I'd haven't automated that in the in this thing yet but the hook cm oh wow you could run a Simon drush config import
the hook you put in your hook sample file to run that command it's definitely one I want to do but the whole hooks
system and I haven't we'll talk about it later we want a refactoring a whole bunch to
make it better you know because there's a lot of other things we would do with this too like check a box and then the
paul ways copied from over here but yeah that's next the river we have overall
features we should have brushed config import as well it's in the backlog their
deployment automation is just to handle webhook webhook is immediate deployment you'd if you can't have a web hook some
people are crazy about like I don't want to expose this to the web or my github so you just it'll pull every minute you
use queue to just manual if you only want to release things manually domain name dist tracks like mmm what the live
domain might be for your reference because you might use this just for your
DEP sites so like if you're a shop and you have your clients are hosted in several places just spend this up and
you can put all your sites in one place and do that make the moment easier on yourself you can plug in multiple
servers so you can point at say you want this web this site to be on that server and then that base to and horse
environments to use those and then the testing is it works now in the box so we
can start right away with this and then github integration is the pull request thing which is the title of the
session you go in here the of information you check create environments you want to delete them when they're merged or deleted you want
can either run the default install or copy another environment but we don't have one yet so we'll come back and
configure that in a minute and then this one will just check this box it'll blow away the whole environment on every
single push she may or may not one and then you hit next and there it is so we
know the branches there's only one branch this is our brand-new projects right there's only one repo so you can
do dev but let's let's just call it live right now let's start with left clone clone from
there I'm so when you hit next it's does it get clone I click plat fast enough
you can actually watch it do the composer install in real time and up oh
okay this is a common problem that I thought we fixed in our little thing but
basically people using composer right now everybody where do you run composer
update matters like the CLI version of PHP matters and you could run the update and then it becomes incompatible with
the older versions so it's telling me my server right now is running seven oh but this packages needs to be seven one for
some reason I well you've bought actually had to configure platform I thought we did that
so I would need to figure out why that didn't work I think it a number change because that's why one of the things we
did in the dev shop composer template
yeah so he's talking about this right
there now it's in there so I don't know what happened because that's
there's a what you know like to not check the cannot check oh yeah do you
think that's what happens which branches this
this is our so it's a bonus anyway the quick fix is we want to fix the template
right but we also want to get our job done so mmm I could just SH in and do it
in the environment itself because this is just a lamp stack so easy anger that's the whole thing build uh Nagar yeah for now so everything goes in
projects that's the main difference with the Hager you don't have to decide where everything goes because who cares so you
go you just tell the project name and we put it in the same place for every project and here's live and here's the
composer update I can do right here and that'll fix check the PHP version I'm running currently and reset all of the
versions to go backwards a little bit and it still works but that's that's a
composer thing it tries to push every version as far ahead as it can yeah
that's true because I you saw the config platform it I thought I already stopped this problem so that I could figure that
over in PHP that you said it might be actually maybe like you've you said
because every version of Drupal that kind of update the minimum so that's actually how that's a good point this how I figured it out this is the
minimum at one point was the mobile version never say how long did it take you to find that because it took me more
than two hours you know what's so funny they don't promote the idea that it exists but it's in the core composer
itself like the composers composer Jason file has that PHP config to set it at a
reasonable version because composer app itself needs to be pretty broad compatibility right with the PHP version
yeah so what's it required
yeah Gordon drupal.org 'it's by five minutes the problem is that it doesn't matter
what requires is because simply it can require something different so that's why you have to have it set of some
things anyway like I said this is like platform problems but now and now it works so
closer install worked we've got to get diff
mmm so when this happens all of acres just task nodes so there's a state
passes or fails on the failed tasks can just be retried so you can just click retry and this thing else go go off on
its way again trying to varrock that verifies oh yeah yeah it's people so
let's see this time oh this isn't it the
way I also need to update the scaffolding command changed so proposer as drupal scaffolds there's one more
change I have to add that to the composer install process otherwise there's no index dot PHP that is yeah
something there of course you can't verify those troopers no one that you just these three issues are all related
another one every scenario is if you install it dev module composer and clones it suite how you have to remove
the git folder oh right commit back in it doesn't actually get included oh yeah you see
when you try you can ignore it maybe you know okay so I don't have to run this
manually every time so we can put this command in composer hooks
this stuff pre-install post-install so this is strange I think the scaffolding
command changed and so if if you want to just run another composure command you do at and then just whatever command it
is and it'll just run that after those won't stop so let me do it again just it
sure does that and then it runs that all
right the site's not PHP all that stuff and now there is Drupal but it's still
ignored just cool so adding
you yeah that's fast typing live demos okay
now that's maybe the supply this times you try there we go so that so does that
test manager like move his my push my expenses with the Eiger Jubal six and I
found that the test morning was somewhat flaky yeah the install script puts the
supervisor in there like we did with the hosting queue Damon run works well okay
so there's that was invented years ago so it probably came after you saw it it's not really necessarily flaky it's
just keeping it running so it's like a Drudge command basically that's right man yeah it just wouldn't it wouldn't be run
right so it's easy you just have to know how to not debug it like there's log files you can look at if you drop a bad
dresser RC file in there it'll completely break because drush is global and so it looks at everything and you're
posting Q command will just stop because you put in that code essentially a good but we can talk about that more later
this more there's definitely like a architecture plan to make everything
better so look at that so eager analyzed all of our site we Nancy Drupal eight
six three we've got the umami demo we've got the standard minimal yeah this is
awesome this umami food demo and then we also try to do everyone made everything so we actually do the set up github
webhook automatically things since we have a given API integration so when I click create it will create our live master
and kick off the installation which is
this is another silly thug I don't know what is good hub API it's there it
creates it and then checks I don't know well get will get in there but it did create it this is brand new repo now
every good push will be detected oh yeah
and that's it the install is done and we can click there whoa oh no no this is
this is my dad the environment live
doctor top top support is already a domain alias I shouldn't I can't use that that's silly
so this is when you go to create an environment you can just press this button there's a bunch of ways to do it you can clone an existing one that we
put everything in this form so I'm just going to create data file master and you
can select install Drupal or leave it empty or clone from live or import from
somewhere else so I'm going to create the demo I'm a food magazine and just click create
because there's a lot of options on whether you get to drag down in
and then does the same thing so two tasks verified platform happens first that's doing the git clone composer
install blah blah yadda yadda yadda all done that succeeded and then the site
install is a second step it takes a little longer than minimal because it's doing the whole Drupal magazine thing
there's a mummy profile
what's the technology you're using to wipe the system
outfit it's a it's an a courier magic
trick so every task that's running is running as a rush command on this site which so
it runs it's called hosting tasks and so all it does is accuse up this verify
task it knows that it's a verified task and then whatever gets run whatever
drush log whatever address log is called it's actually injected into this database into this site into the
database so I have all these logs are just in the Drupal database at the front
yeah there's like modules to clean it up and stuff but the point that's kind of one of the nice things it's all it's
very simple it's all right there like I can easily develop little neat features like click the input filter so these any
link actually returns it to a link I can click you know like in the log it's just raw it's raw and how are you reading
that continuously just John scrimmaging crappy
manual JavaScript stuff but I want to get replaced with something better you know I haven't it a little bit with you
but it's a lot all right so yeah basically it runs in
the context of the site so that it can tell the site changing the status to running start logging all those queries
and then when it's done so all those all the status stuff isn't stored in there there's little properties in the Drupal
database table actually so even i i've even wired up so jenkins runs that drush
commands so we can have more than one running and do a little bit more relaxed um times your tests can be twenty minutes long thirty minutes long so if
you can actually rigged up Jenkins ironically to run the drush listing task one two three like a where you can pass
the note ID directly and run the specific tasks so you just pick a Jenkins job and the note ID is a
parameter and wire it up and it's pretty good for bigger bigger runs oh wait can
we did it work I'm working no Bobby this is Drupal eight built in Drupal 8
it's no profile you haven't seen it yet it's like an entire magazine on the box
it's really great nothing but core modules basic content types one
structured one not so like the in the recipe one has regular fields it's awesome how I get in this is a brand new
site I don't know right so def shop Eggar another maker magic trip trick its
login button it does on the back end yeah it's just address you a lion pipes
its front end and actually it's already expired it's a silly silly bug and I know why you could do it one more time
was great yeah it catches it on that install and then for whatever reason it's it expires by the time you hit it
but you can always request a new one and then BOOM I mean okay
yeah or or maybe not we'll fix it soon but yeah but it's something you do all
the time too you go back in oh I miss the link I'll click it again but this is yeah if you really start to want to you
can kind of start to let your managers and things in and those permissions on
all these buttons actually so if you want to try to give them a limited role and they can't you know deployed code to
a different branch yeah you still have that like hot-swappable upgrade featuring like update Drupal
sales just roll back the whole thing um kind of no I mean the Hager platform
thing yeah no we do still get pulling moving forward I think it stores every
every get pole and stores a log you can see the deployment but the maker used to
make every you'd have to put every changed like in a separate platform where they'd recommend scaffolding the
whole nother second change the Drupal over here and then like migrating the site over so if the development purposes is impossible because you wanted to make
changes very quickly and so by that time aqua client Pantheon came about and
they're making millions of dollars it's just doing good Poland running deployments so that's we did two but we
can build then building the rollback stuff but the idea is you you're doing clones all the time you know see how
like how often would you could prevent merging to master or doing it release at all until you've run it 100 times doing
a test deployment so basically I never have to roll back because I've always been wrong rolling forward so often you
know there's always the crazy sites or you really can't predict like what might maybe they have an external dependency
or something anyway I want to get into the half side of these things right so now we have this development site let's
say we're building in how to what do we want to do we want some actual tests to run right so the bread said this package
already has it well see if what happens of since actually works
yep so it looks in the folder we told it to run it runs this command and it looks
like the behat test does start to run so this first one runs PWD and you get the
output here but this next one doesn't run how is it running it's running
BiPAP but then it says big big enough that yes this is this is because this
test is running itself basically it's not running the whole test it's running
bin - hat - DL which prints the the definitions list they had to print out
all the possible steps and so this way I can verify that it does actually it does actually work it's kind of silly but
this is the I put one I want to put one example test in there so you could get started but the reason it's not working
is because this drush command is failing because I need a little API thing here
so now we get to start editing stuff
or you don't have to click these just scroll up and this little icon will take me right to the github page I go to the
test folder I'm not gonna even bother because we're in a session I can just use github I can click Edit I can just
put API here because without this API I can't call it brush this special step or
the failure does some special stuff with in a neat structure so I gotta add this API to all my tests and you'll see
everything deployed so the github deploy actually triggered like that save triggers I'll get push which triggers
the get pull to get to pull out all these sites so the dev site automatically let's get told yada yada
yada and another composer install no database updates required so you didn't have to configure that it always knows
and that's the cycle you just get push that's deployed and push the play so the
standard environments that are just branch environments we call them don't get destroyed they just stay there until you do something with them you can copy
data from other environments by pushing this data button so list all the other environments like we've copied from live
there's even in database databases and files yeah
destroy this one because Dino's bust lurconis I'll be seven years not November no no another February all
right destroy this one switch it to prod
bye bye so you can just click the lead site is UI is so much nicer what the
Nagar yeah that's the number of the main thing
this is beating right
all right well we're gonna find out the github was subset hmm do you have
integration clone what does
alright wait we're done that's right I was gonna skip ahead to my real side because we have a lot more tests that
work and we'd have to do this new project stuff so that was fun
I've got a PR I need help on it's pretty good
we're redoing our pricing right so mmm turn me out of our homepage it's like
basic your standard stuff with like professional business enterprise
whatever but I'm building a system to let you get a server so what I want to
do is make sure that when you press certain buttons the price comes out correctly on the other end so if you're
buying a server you want the size and this number of users or whatever to equate the certain price because we're
building a SAS right to do this thing so my Drupal code this is just our another
Drupal saying rebuilding this is the portal you'll be using if you're come a customer of us you'll click again a DEP shop server choose whatever team you
want to put it on right and they don't
choose yours here so this is something we built actually using taxonomy so
these are all actually fields that dollar eight or not per month and number of free users and all these things are
are actually programmed in including the extra users and all of this stuff the
upgrades so what I want to make sure is this actually works clearly it's
important it's money right so I think that's right because I wrote the code
but I want to write a test over to confirm it so what I can do is look at
this PR that I have going on here I want to see it let's see we're in the state of the tests are so I can click
this button to view all the different tasks that ran on tests that's green
that's all green oh look at that or log in with right so
this text changed right it must have changed so what happened was this is one
of the features of our new behat extension it spits out better debug information this part is the hat it
tells you was not found in the text of the current page but doesn't tell you where that page was or anything else so
we wrote a little plugin to react to the failure to tell you where where it happened so we'll tell you the actual URL the live URL so I could click that
and see that's that doesn't make sense as I'm logged in right but I can see what did the test see it's actually
saving that file the HTML output so I can click that and see that's what I wanted to see this is what this is just
static HTML that the test runner saw in fact gives the developers super easy insight into what's wrong with the test
so instead of we change the text here sign in with something else okay so if I
go back to look at the test or login with that's the wrong part and go right
back to the PR
I can go to files change and look for this feature file
weightlessness look here [Music]
servers
right here or login with I change this
or oh it's actually case sensitive and that's CSS doing that so I just want to
make sure I'm looking at the right thing look at this
inspect I'm gonna waste our time here with all these pushes tests get it right
first time it's camel case here first
character
and I don't think this exists either so I'm just gonna leave it out for now it's
better to have a passing test that no test at all like you're gonna get to comment it out again I don't know why this one won't pass it looks fine to me
as a human it happens just comment it out so you commit and we I'll show you
that PR you you I this time we saw all the moving gears on the deaf shop side that we also interact with the github UI
okay so you put your API key and actually you can get tell github where
it's going so you see the URL there and so the developers don't even have to leave github they can just click this is
a link to the environment itself so this some checks haven't completed yet that's you this is github it's me pinko CIA
right actually tracking here yeah it's like this is probably github commit I
can't remember exactly which one it is but you can tell github any number of checks so like every system uses this
basically a even platform SH and Provo Travis does yeah so but basically yeah
this way you can tell the deploys a test and the test its the tests are a test the deploy is just a get polling would
update DBA tour details this is a link to stuff so this is a link to the actual
dashboard we tell it the link as well so github lets us tell get tailgate have an
API with the link is so this this link goes straight to the test results but they're not quite running yet so it doesn't link there
it's how many people are working on this
it's mostly me I got a couple I got PRS at least three or four a year more let's
be it's more and more but there it is so the deploy worked you can click details to see the deploy
tap go straight to the deploy task so you can see what happened there and
yeah and it actually changes the tense to say deployed to and you can click that to see there is a new code what I
didn't change in Chrome but we change the test
here we go and we have test failure so
but I can quickly go click details go straight to the test results scroll down see where it failed
[Music] can you see so why don't you ah okay
yeah I'll see there you go you know I didn't my test isn't filling out enough information I removed the the size or I'm not
displaying the size I guess so small is not on this page just correct yeah
this was it started 3 right 15 minutes so anyway you kind of get the idea I'm
gonna go in and write given I fill in this for that I'll show you let's look at the test test run in more detail
while it rolls by because I couldn't again I can I don't have to do wait for a commit it's Aker I get this we try and run the thing
again so that's handy
so if you're not using the Hat and the Drupal thing you really should like giving them logged in as a user with
certain roles you can switch from one user to the other it'll save your life
if you're doing anything with access control anything where you have a complex form then you absolutely have to catch a bad data before it gets in there
you can confer I I start running a test and I start running a form but then I say wait a minute the very first step
should be then I press the submit button and I should see no this is required so
before you even fill in a thing go ahead and write the one extra line that says press the button just to make sure you're about empty text validation is
working for example so I've done some really really complicated testing where like you can upload files I have a test
that uploaded like four spreadsheets and only one of them had good data specifically so we could catch like a
bad date next someone was entering because this system passed on that thing into other stuff and so our behat tests
were able to catch even this like bulk upload our system is awesome you're the
hat testing is writing custom whatever you call those steps yeah anybody really
depends on how much work you want to do there thanks not much it's very little
yeah once in a while there's like a little like like I add a couple extra steps to the hat plugin they'll show you
they had the headaches we wrote our arm to hat extension that simply extends does one of the exists and we created
like then I take a screenshot and when I run command it just does shell exact on my command and like this one didn't
exist in the bad extension because it only did an exact match on the label and
so I needed to test that that's that's where the small thing came in or that was actually best that smells later but I select the radio button because I do
these I groove my radio buttons to include a bunch of text in that label so I couldn't put all of that text in my
test so I rewrote this you know so it really really depends on your project
because like there's a really good blog post by rural miles
there's really good blog post about rural miles about how like I think we're all you can totally overdo it with these
behat tests because you'll have like a hundred steps just to replicate like one node or something once you get to that
point where you've debunked it out in case you get that bug again you need to
replicate that but writing one function to like create the node and like you
know it can be better because if the Baptist you can show your stakeholders and stuff and then once it gets too long
it gets a little you lose track of where you are you know because this machine is running and the person's trying to catch
up but if you have a step that simply says given that crazy situation exists
it's causing all this you put into the code and it's the make libraries are
super easy to use it's on object oriented so if use PHP you just say like mint context then I clicked it every
step refers to a method already so you can recreate all that all of this stuff in PHP it's all there ready for you to
play with anyway yeah alright let's let's see
let's do a little simpler one because I like to handle with it with the deployment it's fine
yeah I actually just merged one protest so so we can make a new one because I have something else on my homepage yeah
that's right I have the new login login with github thing on my phone page so I
simply just want to make sure this is here join with github so write one test
is infinitely better than zero test so we're gonna add one line and deploy it just because we can in less than five
minutes so I go into github I'm gonna this is even cooler because it takes they they just built a great UI here I
can open up no it's not to service let's use this test I can hit edit
I can see given an idol anonymous users while I'm on home then I should see
it's too sure are you able to look into the properties
of things oh yeah you can do selectors and like yeah yeah yeah you can do like
given I this this text should appear in this element like all sorts of stuff and
that gherkin yeah
so this will even let me make a new branch and make a new pull request very
quickly their tests
great pull requests it pings deaf shop things right back I keep forgetting to go checkbox to
trigger live the first first appointment
doesn't run the tests because the environments not set up to do it I can go back in my project right support
there's PR 43 on its way and so in good
environment settings and change the deployment hooks to run tests
and this time to install is a sink so you can see here it's doing the database sink
my dad this is getting bigger and bigger all the time since there we go register your billing updating database
overall features totally dumb play the caches and screen so I mind there's PR
43 okay I've got the clone can we get a test run on that sucker
long time I'm just gonna run it by hand once then
we're going and edit that the test make sure if it doesn't work that guys closed
all this is installing it to the test folder it's running composer install
inside the test folder yeah so you could still have your own custom composer work
weird I think it's a button you have to say oh test worked technically the test
is passed exactly
oh because this branch is not my pricing branch this is there is no get up button
there yet to get up on is in my PR in their online their PR that's not ready to merge fine no problem we'll just use
some other taxis yeah I could do a cherry pick one button wait a minute I
kind of want to I mean it's just the button the button the github vloggin already works and I'm doing demos on
when I click signup and then click github then click log in with you know so yeah let's check that all right
it's just crazy enough to work pricing model redux yep clock's ticking eight
minutes that is each monster pull
request yeah it's getting big well let's change our whole pricing model I'm getting like automated calculations okay
but one I know actually I know where the file is that we fast would find the file in the commitment it's a special do I
think yeah this one it's totally static
hackery there is so what's the commit
commit
well there's get a vote let me check to make
sure take I think so
can tests
yeah nope that's too much
that's gonna be a lot of stuff I think alright I'll just run a secret test best
yeah
there goes there's the automatic tests trigger
sitting there cute
like really hot the install is the get install his
generic term Jeff for clone or install
is it's much easier to say it's installed from that status of that task
yeah mm-hmm I'm curious what a control that gives you over
yeah I mean it basically yeah you can have a test you can hook it on tests or you can hook it on deploy I think even
other things I think even verify I put they put it in there so whatever is running that whatever is in there is
just run it's like shell exactly or whatever yeah it's yeah well I mean what
are you thinking specifically I can't I mean I try to make it possible to do whatever you need so hit me up after it
yeah but I did like what you're thinking of yeah basically all the stuff that's
kind of standard after all Drupal we put in we try to build in you know is instead of making you do it over and
over again through every project
well I get any sane is just so fantastic
her project well I mean what would you want to modify like there's a gig get deployed
task is get pulling oh right now the
install yeah install read the site install profile like I would like to do that we could do talk about doing that
customizing there but the config install is down to fall you could just drop the config folder and you don't even need the scepter a separate command for
Drupal site install when you make a
profile you can now just copy a whole config folder into the install profile it'll automatically import that
configure it's what I'm saying and then you don't need a specialist install command ok oh four minutes
so silly test doesn't work then I should not see join with good now boom that way
we could fix it later it'll fail that made they'll fail in my PR so remind me to fix my test because
it will see the join with github
away it goes once again alright yeah what I click merge it's just a ploy
semester so you can imagine it and I'll let you know let us end with some questions as we wait for the final test
to pass so that's my talk yeah let's do
this real quick how to get the thing though our open source placeholder
website get dev chef Thomas links to the github get our chatroom documentation the one-line install script is right
there you can find it on that page this is the docs page this is our portal for
signing up for the service that we're trying to launch and that's it poster of
PR environments and the head testing session that make camp thanks
and yeah I'll be there about a couple hours at this at the table Center afterparty Seth you'll talk hit me up
alright thanks for right thank you
English (auto-generated)
Host Your Own Pull Request Environments with Automated Behat Testing
Do you host your own Drupal?
Do you wish you could have that great git-push-deploy workflow provided by so many hosted solutions, but on your own servers?
Wish no more!
With Open Source DevShop, you can use any linux server to host, test, and develop your Drupal sites.
DevShop installs in minutes, with no special script writing or configuration required.
In this session, we will demonstrate Automated Pull-Request-Environments with Behat testing, completing and deploying a new feature of our website LIVE in session!
See https://devshop.support for more information.
Frequently Asked Questions:
How does it work?
DevShop is just a Drupal site that manages a basic LAMP stack. All of the logic and all of the service to make it work are self-contained in the Drupal code. This makes it quite easy to understand. If you know PHP and Drupal, you can learn DevShop. There are optional modules for Docker, but it's not necessary. DevShop runs on a single server.
Is this a hosted service?
No. DevShop is 100% open source. We do not provide hosting services directly. However, if you run your own server, you can sign up for DevShop.Support if you ever need help or SLA-level hosting service.
Is this used in production?
Yes. DevShop was originally created as an extension of Aegir in February of 2012. It was used in production as soon as it was created.
Audience Level
Beginner
Topic
DevOps