Having Some Fun With Continuous Integration

I had an interesting day at work today, as I was configuring a new project work with our CI server, and have things like Unit/UI Tests in a readable format, and also convert the code coverage into something that could be stored along with the build artefacts.

Just for some background, we use Bamboo as a server, and I’m pretty limited with what I can actually configure myself, without getting someone with higher privileges. So I try to work within my limitations, and see what I can come up with.

I use Fastlane as the main solution to manage the whole process. And that means I can use the scan and slather commands to do the heavy lifting for the testing/code coverage. The way I had to integrate it in our CI server was reasonably simple. The test results were handled by setting the output type to junit, and then adding a simple JUnit Parser task on Bamboo. The code coverage was slightly more complex, as it needed me to run a python package that converts it into a “Clover” format that Bamboo could understand.

What was more tricky, was getting this data nicely formatted when it was sent to our Slack room. The previous build plans all had notifications handled form Bamboo, and it just gave a short message with the number of tests that passed/failed. I wanted more insight this time though, as I knew the test data was available, and also that I had code coverage being generated. I decided that the simplest (maybe it wasn’t in the end) solution was to just find a way to read the information from the .xml files, and send a custom message to Slack as part of the Fastlane process.

What I ended up with is a kind of monstrous-masterpiece. In Fastlane I had the Slack command being called with some basic information about the build, such as the branch, project name, and whether it passed/failed. But to get the results of the Unit/UI tests, I thought I’d use grep to find the line in the junit file that had text like “tests=100 failures=0”, I then used sed to clean up the surrounding text, and had the final output as “Passed: 100, Failed: 0”. The code coverage was slightly harder. I used grep and sed again in the same way to find the total code coverage, but it was formatted like “1.00000000”, and I wanted a percentage. So I piped that through bc with a small calculation, and they’re not formatted as a percentage with two decimal spaces.

Then with some magic of environment variables, I added two build-specific URLs to the message payload. One for the build details, and the other which linked directly to the code coverage report.

What I ended up with was something like this:

  • iOS App
  • Tests Passed: 100, Failed: 0
  • Code Coverage 100.00%
  • Coverage URL https://build.com/coverage/IOS_BUILD_99
  • Build URL https://build.com/IOS_BUILD_99/something
  • Result Success
  • Git Branch master

I’m not sure if all of that is relevant for each build, or if I’ll have to include some other things I’ve forgotten about. But what I can say, is that it was really fun to come with all of these little scripts that come together with something so simple at the end. And it’s quite likely that no-one else seeing the messages will have any idea the lengths I went to to make everything appear so simple.

Journal: 18 Feb 2019

Nothing really interesting at work today, apart from working on a release build for an app. So I’ll skip over the first half of the day for this entry.

I’ve been productive in a few areas today outside of work. I wrote another few hundred words for the Nintendo Switch/Pokemon review I’m working on, and I worked on Text Case some more!

I honestly thought I would have been finishing off the review tonight, but as I started writing the piece, I realised it was a bit bigger than I first thought. That’s good though, because I have a lot to talk about!

In the mean time, I did switch back to iA Writer. I’ve been using Ulysses for the past few years, and it’s served me well, but there’s a lot of benefits to iA Writer. So expect a short article on that soon as well.

With Text Case, I finally got around to doing a bit of work on the redesign. When I first completed the draft of the redesign I wanted more colours, so I gave every format a gradient background, and had a specific colour for each section. It always felt half-finished though, and I worked out what the issue was. It was hard to read the formatted text, and it just didn’t look as professional anymore.

I countered this by making the bottom portion of the format be more like the textfield colour, and the text colour to match. It resulted in an instantly recognisable upgrade, I think it’s much better with this slight change. And it makes the results completely readable, which is hard to get when mixing various colours with black text.

I’ve uploaded a build to Apple/TestFlight, and it’s currently waiting to be reviewed before it can be released to everyone. But feel free to sign up to to the beta, and be one of the first users to ever see the 2.0 redesign!

Journal: 17 Feb 2019

It’s been a relatively quite day today. The majority of it was spent lounging round the house. I made omelettes for breakfast, we then watched TV, and I played a bit of Pokémon on the Switch (of course).

After that we went into town to get a few things for the house, and on the way back home, we popped into my parents house to collect a few things. Obviously I was made to make the coffee and tea for everyone.

Then for dinner we had a pasta bake, which took nearly double the expected time, as it appears our oven is wildly inaccurate. I’ll have to do some research to see if we have anything set wrong, because I don’t want to buy an oven.

Apart from the boring day activities, I also started actually writing a piece in the Nintendo Switch and the latest Pokémon game. Over the past few days I’ve been noting down things as I played the game, and from that I worked out a rough outline of what I’m going to write about. And I think I should have it published Monday, or possibly Tuesday if time gets the best of me.

Journal: 16 Feb 2019

So today started with me watching about four episodes of Lost, while playing endless more hours of Pokémon on my Nintendo Switch!

After a few hours, me and my girlfriend finally built her wardrobe. It’s not complicated, but it’s absolutely huge, and it requires two sets of hands to hold things in place.

The wardrobe, along with watching a few YouTube videos, took us to about 8 pm. So we decided to go out for dinner, instead of starting to make something. We went to an average chain restaurant. It wasn’t great, but I guess it’s easier than cooking dinner ourselves.

We ended the day watching old school videos of ourselves. As we’ve found a lot of old content on YouTube of the time we were both at school together.

Journal: 15 Feb 2019

It’s finally the end of the week! And fortunately, it means that the training course I was on at work is finished. It was about iterative delivery, and how to vertically slice projects, so you can produce deliverables in a shorter period of time, and a lot of other things. It was beneficial, but I’d much rather spend my time writing code.

We’ve been going through a big rewrite of one of our apps, and we finally got to a point where a build has been accepted by Apple. It turns out that’s not the build we will be releasing, as there are a few extra tweaks needed. But my boss thought it was something worth celebrating, so he purchased a bottle of spiced rum (70% alcohol content 🤯) for any celebratory events, as our team are known as the “Corsairs” (long story, but we even have a pirate flag). It certainly warmed my body for a while.

As I was leaving work, I noticed the buildings on the other side of the river (Thames) were looking rather intriguing, it was if HDR was being applied in real-life. The sky was a brightish blue, with the street lamps bright, and light still reflecting off the glass buildings. It’s not a great photo, as I took as I was walking out of the door, but I can’t change that now.

Tonight, I ate some more of the cheesecake that my girlfriend made me for Valentine’s day. It’s amazing. And fortunately, it’s going to last for quite a while.

Apart from that, I’ve started to rewatch Lost, as it’s now on Amazon Prime Video! But at the same time as that, I’ve also been keeping up with my Pokémon game on the Nintendo Switch. Hopefully, I’ll spend some time to write about it at the weekend, but I’m really enjoying the game and the console as a whole.

Journal: 14 Feb 2019

So it’s Valentine’s Day today! However, mine didn’t go the same as most other people. I worked the usual time, and my girlfriend is on a night shift tonight, so we didn’t actually spend any time together at all. I got back mere minutes after she left! However, when I got back to our house, I was greeted by one of her amazing cheesecakes!

Apart from eating that, I didn’t the usual work and Nintendo Switch playing. But I also watched Arsenal okay BATE Borisov, and unfortunately we lost 1-0. It wasn’t a great team selection or performance, and I’m starting to already question our new manager. It’s certainly not the situation I expected Arsenal football club to be in.

Journal: 13 Feb 2019

A similar day to yesterday, it involved mainly work and playing on my new Nintendo Switch.

It wasn’t that boring at work though, as I was trying out BDD tests in an iOS app! Took some investigation, and a bit of patience from myself, but I now have working UI tests running from a Gherkin format .feature file. There was a lot of different BDD options to go for, but I didn’t feel like any of them really stood out. The main differences I saw were the level of Gherkin syntax, and the ease of writing the actual implementation of the steps. Cucumberish, the one I’m working with at the moment, seems to be on the side of practically perfect Gherkin syntax, but ugly implementation.

Apart from that, like I said at the start of this entry, I’ve been playing Pokémon: Let’s Go, Pikachu a ton. After two days, I have the first two badges, seen 49 different Pokémon, and caught 29. And if you count duplicates, then I’ve already caught 62!

Journal: 12 Feb 2019

A relatively short entry today. As it wasn’t varied at all.

I spent the first two thirds of my day at work, where I was focusing on getting a release build ready for one of our apps.

While I was at work, my Nintendo Switch arrived. So that’s what I’ve been doing for the rest of the day. I got the Pokémon: Let’s Go, Pikachu edition, and it’s amazing. Every part of it is styled perfectly, and I’m enjoying the game. I want to go into much more detail, but that’s going to be a separate post when I’ve played it a bit more.

Apart from that, I haven’t done anything today! I’m sure you can now see why it’s a short entry.

Journal: 11 Feb 2019

A relatively uninteresting day at work today! I continued slow progress on a new project. It involved me researching more about the MVVM pattern, and also creating more unit tests.

I thankfully got around to listen to some podcast episodes as well today. I haven’t been very good at keeping up with my long queue recently, but I managed an episode of Cortex and Connected.

Something that really interested me today, was a big list of shows that the BBC are producing. There’s at least 8 (well, the ones I care about) great shows that have been announced. I shared this on my blog, along with a short description of each, and links to the original press releases.

One more thing, I made a purchase today. A Nintendo Switch! To be exact, the Nintendo Switch Pokémon: Let’s Go, Pikachu! Edition Pack. The entire console, case, and JoyCons are Pikachu themed, and it comes bundled with the game! It’s arriving tomorrow, so from then I assume I’ll be obsessed with it.

BBC Earth Announce 8 New TV Nature Documentaries

(Image credit: BBC Earth)

If you’re interested in nature documentaries, then the BBC have quite the announcement for you. In two news articles (linked at the bottom), they announced 8 new television series about natural history.

The five main shows are:

  • Perfect Planet
  • Frozen Planet II
  • Planet Earth III
  • One Planet: Seven Worlds
  • Green Planet

And they also announced three extra shows:

  • The Mating Game
  • Primates
  • Earth’s Paradise Islands

That’s such a massive commitment from them, and I’m already super excited.

Perfect Planet

In the five-part series, we’ll see how the entire planet which is seemingly “perfect”, operates. It will show how the weather, ocean currents, solar energy, and volcanoes all play their part in supporting Earth’s diverse biological population. We’ll also get to see how certain animals are well-suited to their environments, such as the Vampire Finches in the Galapagos, which are part of the diverse group, known as Darwin’s Finches.

Episodes: 5 x 60 mins

Transmission: 2020

Frozen Planet II

Ten years after Frozen Planet first aired, the second series is being released. As the name suggests, it focusses on the quarter of the earth that is entirely frozen. Animals such as the Siberian tiger, snow monkeys, penguins, and polar bears all thrive in cold conditions. But as temperatures rise, they might not be able to cope as easily.

Episodes: 6 x 60 mins

Transmission: 2021

Planet Earth III

Following on from the second series, that aired only back in late 2016, is coming back for a whopping eight-episode series. As usual, improvements to technology, such as robotic cameras, better submersibles, and stabilised rigs, will only help us see the planet in more detail.

Episodes: 8 x 60 mins

Transmission: 2022

One Planet: Seven Worlds

This series will be split into seven episodes, one for each of the continents (Well actually Eurasia is one continent, but people treat it as two). We’ll see how distinct each continent is from each other, and how they have shaped the life that’s found there.

Episodes: 7 x 60 mins

Transmission: 2019

Green Planet

Something that sometimes gets ignored on tv documentaries, is plant-life. Usually, the focus is on the animals living in specific habitats, but this series will focus on the surprisingly intricate life of plants.

I’ve read a lot on how trees communicate, using electrical signals through their roots (that are connected by fungi), so I hope this gets shown in more detail.

Episodes: 5 x 60 mins

Transmission: 2021

The Mating Game

Okay, so nearly every species on the planet needs to find some kind of partner to mate with. This series will show how various species have completely different ideas of what’s the best method of finding one. Some fight, others sing songs, and some dance. This sounds like it could provide a very interesting insight into unknown behaviours of animals. And there’s a technological bonus with this series, it’s being filmed in 8K!

Episodes: 5 x 60 mins

Transmission: 2021

Primates

There are a huge number of species of primates. Including apes, lemurs, and monkeys. They’re found all over the planet, in vastly different habitats from one another. And there’s one writing this very blog post. We’ll get to see new sides to these animals, how they use tools, solve problems, and also have a glance into their politics.

Episodes: 3 x 60 mins

Transmission: 2020

Earth’s Paradise Islands

Madagascar, Borneo, and Hawaii, are all exotic and remote islands. And in each of them, there’s fascinating animal species, and human cultures. So it sounds like it will be two sides to each story.

Episodes: 3 x 60 mins

Transmission: Unknown


Sources: