All changes, no matter how trivial, must be done via pull request. Commits
should never be made directly on the develop
branch. Prefer rebasing over
merging develop
into your PR branch to update it and resolve conflicts.
master
branches are for releases only.
In addition, you must follow these rules
-
Create an issue before creating a PR where you describe the problem. Your issue should be limited to only one problem.
-
All PR commits must reference an issue and provide a brief commit message about the commit. Here is an example
#123456 - Fixed an issue with unhanded client errors.
When writing a unit test, please be sure to follow these rules.
-
You test has this structure
expect{ ClassYouAreTesting().value() }.To( expectedValue, "Description of the test intention. (e.g. "Returned value must be in the 1..5 range.")" )
However, test failure description is not necessary, if the class you are testing implements the
Error
protocol. -
If you are creating fake classes/decorators for a test, make sure that these classes are named as
FakeXXXX
. -
The usage of the setUp() and tearDown() methods is prohibited.
-
The tests must not share any test values, such as sample input values. The only exception is the test resources, like directory path or test API URL. (These must be structured according to test rule #3)
See this for more information.
-
Your test has proper documentation, which explains what class it is testing in the format specified below
// // This source file is part of the Web3Swift.io open source project // Copyright 2018 The Web3Swift Authors // Licensed under Apache License v2.0 // // ClassNameTest.swift // // Created by FirstName LastName on DD/MM/YYY //
-
The name of the unit test source file has to follow this structure
ClassNameTest.swift
-
The name of the integration test source file has to follow this structure
ClassNameIT.swift