Getting Started with Node.js and Mocha

Mocha is a testing library for Node.js, created to be a simple, extensible, and fast. It’s used for unit and integration testing, and it’s a great candidate for BDD (Behavior Driven Development). This article will walk you through its installation and configuration, as well as demonstrate its usage by implementing a color converter that can translate from RGB (red, green, blue) to hexadecimal color representation. In addition, we will create…

Getting Started with PHPUnit in Laravel

Introduction PHPUnit is one of the oldest and most well-known unit testing packages for PHP. It is primarily designed for unit testing, which means testing your code in the smallest components possible, but it is also incredibly flexible and can be used for a lot more than just unit testing. PHPUnit includes a lot of simple and flexible assertions that allow you to easily test your code, which works really…

How to Test Rails Models with RSpec

Testing is where we spend most of our time as developers. Good testing raises the quality of software, reduces bugs and, in the long run, makes our work easier. In this article, we’ll discuss the basics of testing with Ruby on Rails: What is BDD? How to test models in Rails? How to test business logic with Rspec? How to use Continuous Integration to automate testing? What is Behaviour-driven Development?…

Dockerizing a Node.js Web Application

Introduction If you’ve ever developed anything that needs to ‘live’ somewhere besides your local machine, you know that getting an application up and running on a different machine is no simple task. There are countless considerations to be had, from the very basics of “how do I get my environment variables set” to which runtimes you’ll need and which dependencies those will rely on, not to mention the need to…

Getting Started with RSpec

RSpec is a testing tool for Ruby, created for behavior-driven development (BDD). It is the most frequently used testing library for Ruby in production applications. Even though it has a very rich and powerful DSL (domain-specific language), at its core it is a simple tool which you can start using rather quickly. This RSpec tutorial will help you get started, assuming you have no prior experience with the library and…

Dockerizing a Ruby on Rails Application

Introduction In this tutorial, you will learn how to dockerize a Ruby on Rails application. The application we’re going to build will make use of PostgreSQL, Redis, and Sidekiq. We’ll also be using Unicorn and Nginx in both development and production. If you would prefer to use Puma or something else, this shouldn’t be an issue. After reading this article: You will have a basic idea of what Docker is.…

Building Go Web Applications and Microservices Using Gin

Introduction In this tutorial, you will learn how to build traditional web applications and microservices in Go using the Gin framework. Gin is a framework which reduces boilerplate code that would normally go into building these applications. It also lends itself very well to creating reusable and extensible pieces of code. This part of the tutorial will help you set up your project and build a simple application using Gin…

Dockerizing a Python Django Web Application

Introduction This article will cover building a markdown editor application written in Django and running it in the much talked about and discussed Docker. Docker takes all the great aspects of a traditional virtual machine, e.g. a self contained system isolated from your development machine, and removes many of the drawbacks such as system resource drain, setup time, and maintenance. When building web applications, you have probably reached a point…

Dockerizing a PHP Application

In this tutorial, you will learn what Docker is and how to use it to create a portable image for your PHP applications. You’ll learn how to use Continuous Integration and Deployment (CI/CD) to build and deploy the image on Heroku. Dockerizing your PHP Application is beneficial because: Containers are portable and can be deployed instantly anywhere. Containers bring developers a uniform and streamlined work environment that can be easily…

How To Build and Deploy a Node.js Application To DigitalOcean Kubernetes Using CI/CD

This article was originally published on DigitalOcean on October 10, 2019. Kubernetes allows users to create resilient and scalable services with a single command. Like anything that sounds too good to be true, it has a catch: you must first prepare a suitable Docker image and thoroughly test it. Continuous Integration (CI) is the practice of testing the application on each update. Doing this manually is tedious and error-prone, but a CI platform runs…

A Step-by-Step Guide to Continuous Deployment on Kubernetes

How to deploy an app to Kubernetes by creating a working Kubernetes deployment and continuous delivery workflow.

Stubbing and Mocking in Java with the Spock Testing Framework

Introduction When it comes to true unit tests, having a mocking framework such as Spock for Java is essential. Using a mocking framework ensures that your unit tests are fast, self-contained and deterministic. A mocking framework can help you fake external systems, pre-program your classes with expected responses, and test hard-to-replicate error conditions. There are several mocking frameworks in the Java world, but the most popular one is Mockito. Our…

Tutorial: Build, Test, & Deploy an iOS App with CI/CD

When we develop iOS apps, we usually manage the app publication process using the Xcode Organizer. Then we sign, test, build, archive, submit, change versions, submit new builds again and again to the TestFlight or AppStore. If we generate our builds daily, this process is tedious and tiring. Sooner or later, you will ask yourself: How can we automate this entire process? Continuous Integration and Continuous Delivery (CI/CD) for iOS enable us to…

How to Release Faster with Continuous Delivery for Google Kubernetes

In this hands-on post, we’ll learn to deliver continuously a demo application to Google Kubernetes using Semaphore CI/CD.

Getting Started with Mocking in Python

Introduction Mocking is simply the act of replacing the part of the application you are testing with a dummy version of that part called a mock. Instead of calling the actual implementation, you would call the mock, and then make assertions about what you expect to happen. What are the benefits of mocking? Increased speed — Tests that run quickly are extremely beneficial. E.g. if you have a very resource-intensive…

1 2 3 31