Practicing with running WordPress in Docker today

So one of the things I want to do during my between-jobs downtime is practice my coding. And in particular, since I thought it’d be nice to a) start small and b) play with something I’m actually interested in coding (as opposed to, say, just focusing on random interview-type questions which will eventually bore me to tears), I decided I’d try to play with making a small WordPress plugin.

I’ve already done one that I’m running locally on Annathepiper.org: namely, to show y’all my archive of roleplay logs. Eventually I want to do a newer version of that, something that might let me actually practice setting up a simple web service.

For now though I’m going to do something less complicated. There’s a very old plugin called “lj-tag-parser”. This thing has a very simple job: allowing the LJ-style syntax for usernames and communities in your WordPress posts and comments. I’m using it right here on annathepiper.org, which is why you can actually see LJ-style usernames and tags if I write something like, say, userinfoannathepiper.

However, this thing hasn’t been updated in ages. And I thought it’d be nice to expand it to allow Dreamwidth-style syntax in addition to LJ-style, and possibly also allow generation of such tags via shortcodes.

But before I do all of that, I wanted to make sure I could set up a clean WordPress dev install.

In the past, when I’ve played around with dev-type WordPress stuff, I just did this on a separate blog on my annathepiper.org network. But coming at this with my SDET hat on, I thought it’d be cleaner and more appropriate to developing my coding experience if I set it up the way I’d do it in a work environment.

Which means a brand new, clean WordPress dev install. And in particular, using official WordPress and MySQL images from Docker.

For those of you who aren’t in the tech industry, suffice to say that Docker is a tool that lets you do exactly this kind of thing. You can set up a thing you want to play with in its own little container on your system, without having to worry about it interfering with anything else you might be doing. Docker lets you go about this in a few different ways. You can go get official images for things (like, say, the latest WordPress install) and do a single run using that image.

Or, if you want to do something a bit more complicated (like, say, running the official WordPress image AND a MySQL image that you’ll need to actually power the WordPress install), you can chain them together using a thing called Docker Compose.

Docker Compose works by you setting up all the config data you need in a file called docker-compose.yml. I’m still fairly new to the syntax this thing requires, but fortunately, I learned a bit about it while I was still at my previous day job at Big Fish. So I was able to utilize that knowledge to build a file that’d let me set up that clean WordPress dev install I want.

I did have to jump through a few hoops to get all the info I needed, though. Here are some pages that proved useful:

So now, as of this writing, I have a nice little set of Docker containers running on my dev box on Linux. And the nice thing about doing this via Docker, especially, is that I could take this exact same docker-compose.yml, reboot my box into Windows, and use it there too. All I need to be running locally is Docker and Docker Compose. The rest of it comes in with the images I specify!

And for the interested, I have checked in my final docker-compose.yml up on my personal Github account, and you can see it right here.

Rough test plan for my first indie SDET project

In order to keep my SDET skills active, and to have something I can point hiring managers at, I’m going to do some test projects that will use this very site as the test bed. Here’s a rough plan for how this is going to work.

Requirements

  • Using Python, write a small Selenium suite that will test dev.annathepiper.org from the front end.
  • Using Java, write a separate suite that will use standard WordPress API endpoints to verify the site.
  • Also using Java, since I did this recently in a research task at my last job, show how I’d do Selenium-based testing against the site. Use Selenide as the framework for doing this.
  • Version 1 of this project should be a BVT-level thing that will be testing basic front-end things like “are there pages?” and “are there posts?”
  • Version 1 from the API level should be essentially testing the same BVT level things, only querying via REST as opposed to hitting pages on the site.
  • Stretch goal for the front end: a test that verifies you can leave a comment on a previously existing post.

Test Environments

  • Ubuntu, since that was the environment I most often worked with in my last position.
  • Windows 10, with the Ubuntu subsystem installed.

Both of these are installed on Savah, my dev box, which dual boots between those two operating systems.

Additional tools I plan to use:

  • For the Java code, I’ll be using IntelliJ as that’s what I’m most recently familiar with.
  • Within IntelliJ, I’ll be setting it up to run the tests as a TestNG suite, but also through Maven.
  • For the Python, I will also be doublechecking if IntelliJ will let me deal with Python. If it doesn’t, I will be doing one of two things: investigating PyCharm to see if I like it, and failing that, installing Eclipse. (Eclipse was the last thing I worked with in depth for Python code.)
  • For manual verification of any WordPress endpoints I want to play with, I’ll be installing Postman.
  • I will be installing a local instance of Jenkins to demonstrate my familiarity with running automation jobs via that.
  • For Selenium server purposes, I’ll be installing Docker and the official Docker Selenium images. I’ll be experimenting with whether I will do a standalone Chrome or Firefox image, or setting up a grid via Docker-Compose. (Prior experience with researching this suggests it’ll be the latter.)

What I’ll Do With the Code

I’ll be creating the Python and Java projects as two separate repos up on my GitHub account (taking steps to make sure that any information I don’t want to reveal about account credentials doesn’t get included).

I will include documentation. And, time permitting, perhaps a Powerpoint slideshow to talk about it.

More on this as it develops!

My history with test plans

My last position was pretty standard in terms of how testing a project went. Something like this, in a rather loose implementation of Agile methodology:

  1. Project management, Dev, and QA got together to go over a project concept and discuss what it was asking for. Usually, but not always, this would involve reviewing a BRD (“business requirements document”) or a spec. These could involve wireframes from Design, actual mock screenshots, written expectations for how a thing should work, or all or none of the above.
  2. Sometimes in the same meeting, or sometimes in a different meeting, we’d discuss the logistics of how to implement the desired functionality.
  3. Dev and QA would then task out the expected work. I am familiar with using points to scope out the size of a task, but at this particular position, we mostly just scoped tasks as “this will take me X number of hours to do”.
  4. Once we had the tasks, we’d agree who was expected to perform what, and see how long it would take us to accomplish them so we could commit to a release date. Sometimes this would take us just a single two-week sprint, maybe two depending on how long Dev would need before handing off to QA.

Now, as a member of the QA team, it’d be on me to work with the expected plan for how to test things. Usually this plan would be whatever set of tasks we’d committed to for any given sprint, and we’d take care to write out within each task what the expected work would be. These tasks would often be based on the BRD of whatever we were testing.

But for larger projects, particularly ones where we’d need to pull in external help, we’d often write out actual test cases to use for reference. The tool we most often used for this was TestRail.

Why do I mention all of this?

Partly to go into a bit of detail about my most recent experience with testing, so that I can be able to coherently describe it for later interviews. But also because I want to lay the groundwork for how I plan to do a couple of test projects against this very site.

More on that in forthcoming posts.

Let’s get this party started

Last month I was laid off from my last job, where I was an SDET. As of this writing I’ve been spending the last couple of weeks looking for a new position–and as anybody who’s worked in the tech industry goes, interview loops can be pretty involved and detailed.

My problem: I haven’t been in an actual interview loop for nearly ten years. So I’m out of practice answering the sorts of questions such loops will often give you, like, say, “write me a method that’ll return the smallest integer in an array” or “given a list of input integers, how do you see whether a target integer is in that list?”

In my experience these kinds of questions are not usually the sorts of things you’d have used in an actual job situation. But when I’m out of practice with them, it means I look bad during an interview.

So this site is to help me practice my coding skills to keep them in the forefront of my mind, and to have something I can point at for the sake of hiring managers.

I’ve used this dev site before when doing dev work on my main sites, annathepiper.org and angelahighland.com. So I’ve now reset its database, and will be writing a couple of small automation suites to serve as examples of the sorts of things I did on my last position.

More on this to come!