Category: tech
-
Designing Test Quarantine Logic to Deal With Flaky Tests
1. Introduction Flaky tests, known for producing inconsistent results (success or failure) over time, can be a source of frustration for developers. These non-deterministic tests can arise due to various factors, including code issues or an inconsistent testing environment. In this blog post, we will explore the concept of test quarantine, an approach to mitigate the challenges posed by flaky tests. 2. The Need for Test Quarantine 2.1. The Challenge of Flaky Tests Flaky tests are particularly prevalent in certain types of testing, such as UI testing, where the higher level of integration introduces greater complexity.
-
A Tale of Project Build Time Improvement
Introduction Build time is a key factor to engineers’ productivity. Slow build time can be frustrating and lead to hindered progress. There has been a great amount of effort by the community to tackle this complex problem. This blog post highlights various methodologies employed by our team (at Grab) to alleviate this pain point. Background The process of building an iOS project involves multiple steps, including compiling source code, processing resources (headers, assets, storyboards, etc.
-
On Using Python for Scripting in iOS Projects
As an iOS engineer, my recent focus has been on platform work, involving tasks like optimizing build times, integrating CI/CD pipelines, and devising testing solutions. This has led me to explore various scripting options, and I’ve found great satisfaction in using Python as our preferred choice. The first Python code Initially, scripting wasn’t a prominent aspect of my team’s workflow, largely due to the simplicity of our CI/CD setup and the prevalence of Bash scripts in our project.
-
Code Signing on CI
1. Introduction Code signing in iOS refers to the process of digitally signing an app’s executable code to ensure its authenticity and integrity. During feature development, developers usually do not have to worry about code signing because Xcode handles the complicated work. Most of the time, we build and run the app on simulators that do not require special code signing settings. However, distributing the app requires code signing. While working locally, you can rely on the “Automatically manage signing” option in the project settings.
-
50 Shades of Git: Remotes and Authentication
Introduction Git is a software development tool that almost all engineers use in their work. This source control tool enables us to make changes to a project code base collaboratively. However, Git can be a headache at times. When running on CI environment, it sometimes does not work the way it does locally. Moreover, we sometimes follow best practices without knowing much about how it works. This gap together with the limited debug capabilities on CI make it even harder to resolve issues.
-
Cocoapods Explained: Plugins
In the previous post, we talked about Podfile. In this post, we will look into CocoaPods plugins. Back in early days, very few maintainers maintain quite some features. It was difficult for them to stick to the main goals of the project given a number of features being requested. Some features definitely benefit a group of users but they don’t quite fit in the picture of a dependency manager. Instead of rejecting them, CocoaPods provided the support for plugins.
-
CocoaPods Explained: Podfile
In iOS development, CocoaPods has become one of the must-know tools. In a team where CocoaPods is adopted, engineers run pod install as often as git checkout. They know how to properly set up a project with CocoaPods, declare dependencies in Podfile, and update dependencies if needed. However, some have little understanding of what happens under the hood. This prevents them from troubleshooting CocoaPods issues if occurred or extending its usage.
-
Dealing With Flaky UI Tests in iOS
1. Introduction UI testing is a test technique, besides unit testing, to ensure product quality. While unit testing focuses on small portions (or units) of the system, UI testing aims to cover a wider user journey in the app. This testing technique helps engineers gain more confidence when developing, refactoring, and shipping the products to users. In the context of iOS development, UI testing plays a key role in product quality as the form of a feature shipped to users is usually through what they see on the app.
-
CI: Heuristically Extracting Test Methods Before Runtime
1. Introduction Reducing pipeline time is a key problem in the pipeline time reduction epic. As mentioned in the previous post, this can be done by dividing tests in the project into smaller sets and run them in parallel CI jobs (sometimes called runners). The assignment of what tests to what jobs usually takes place at the end of the build job, before tests being executed. In order to assign/distribute tests to runners, we must know what tests we have.
-
CI: Thinning iOS Build Artifacts
1. Introduction 1.1. Pipeline Time Improvement As engineers, we always want to land our change on master as quickly as possible. Apart from the time it takes to resolve code review comments from peers, there’s one constraint engineers have to face before getting their changes merged. That constraint is the CI pipeline time (ie. the time it takes for a CI pipeline to run against certain changes). For iOS development, a typical CI pre-merge pipeline usually involves building the project, then running unit tests and UI tests.