euccas.github.io

why a developer writes

高效Jenkins用户的第4个习惯

| Comments

本文内容部分来源于Andrew Bayer发布在SlideShare上的 7 habits of highly productive Jenkins Users (2014 Edition).

习惯 4: 精选你所使用的Jenkins功能插件(Plugin)

当你使用了越来越多的Jenkins功能插件时,就需要花一些时间和精力来维护和清理所有的功能插件。 因为当你安装了太多的Jenkins插件时,有可能会带来一些不好的效果,诸如减慢系统速度,占用多过资源,产生无效的记录文件等等。为了避免使用过多的Jenkins插件造成的各种问题,你应该注意下面几个方面。

1. 只安装你真正需要的功能插件

在安装一个功能插件之前,你都应该问一个问题:我真的需要这个插件吗?

如果你并不打算真正使用一个插件,就不要安装在Jenkins Master上。

不同的插件可能包含有一些类似的功能,你所需要完成的事情,也不仅仅只有一个插件可以实现。这时就需要在一些功能类似的插件中选择你真正所需的。

功能插件可能会给Jenkins service的稳定性造成预期之外的影响,并且可能增加系统的负载和每一个job运行的时间。充分考虑到这些可能的负作用,尽量避免安装你并不是真正需要的插件。

GTAC: The Uber Challenge of Cross-Application Testing

| Comments

Inspired by Matt Cutts’ TED talk: Try something new for 30 days, I’m starting a “30 Days of GTAC” project. Google’s Test Automation Conference GTAC is an annual test automation conference which brings together engineers from industry and academia to discuss advances in test automation and related engineering tools. In my “30 Days of GTAC” project, I’ll review the topics presented on GTAC. My goal is having a better and deeper understanding in modern testing technologies, methodologies, strategies, and practices.

Get it started! Day#1 topic is:

The Uber Challenge of Cross-Application/Cross-Device Testing

Dunder Methods in Python

| Comments

In Python, we sometimes see method names with __ around, such as the __init__ method that every Class has. These methods are “dunder” methods (“dunder” stands for “double under” or “double underscore”). Dunder methods in Python are used for operator overloading and customizing behavior of other functions.

Sometimes dunder methods are also called “magic methods” because they are usually called by Python under the hood. But they are not really magical, you can define dunder methods to customize the behavior of your own classes.

Examples of Dunder Methods

How to Check Changes in a Commit and Invoke CI Tasks

| Comments

Problem Description

Suppose one task in your Continuous Integration (CI) pipeline is triggered on every commit to the project repository. Some the files in the repository require passing the check of the CI task, while some other files do not require passing the check. What should the CI task do to decide if it is needed to perform the needed checking on the commit?

Design the CI task

The CI task need have the ability to analyze the files included in the commit, and decide whether the commit requires passing a check, or not. We need tell the CI task which files require passing a check through configurations.

Python Unittest: Handle the Command Line Arguments

| Comments

In the previous post about Python Unittest, I wrote about the basic steps needed for setting up unit testing for your Python program with the unittest module. In this post, I’ll discuss about handling the command line parameters that your program need while you’re using Python unittest.

Unit testing is meant for testing basic functionality of the application. The target of Unit testing is expected to be each function of your program. When your program has command line arguments, ideally the unit tests should not accept arguments from the command line because unit tests are supposed to be very specific and not testing on the Integration level (i.e. across multiple functions in your program).