Merge ~racb/git-ubuntu:xfail-style into git-ubuntu:master

Proposed by Robie Basak
Status: Merged
Approved by: Robie Basak
Approved revision: 2894c80181be3239908fd93d2919b46da0876b81
Merged at revision: ff9059685ddd2955af69db86394327ed8ceb3789
Proposed branch: ~racb/git-ubuntu:xfail-style
Merge into: git-ubuntu:master
Diff against target: 29 lines (+21/-0)
1 file modified
doc/STYLE.md (+21/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Bryce Harrington Needs Fixing
Review via email: mp+378829@code.launchpad.net

Commit message

Make Jenkins happy

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

I would only ask a minor change:

  "without its fix, then a good technique is to add the test first in an earlier commit,"

This does seem like a good style to recommend, and seems like it could make some reviews a lot easier to do. But I can imagine situations where it'd impose an extra hoop to jump through as a contributor, and may be most beneficial to git-ubuntu to express it more as a strong suggestion than requirement.

review: Needs Fixing
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:e198f3ae453abc977eb2ab25bd78d8e3da921447
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/473/
Executed test runs:
    SUCCESS: VM Setup
    SUCCESS: Build
    SUCCESS: Unit Tests
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/473//rebuild

review: Approve (continuous-integration)
Revision history for this message
Robie Basak (racb) wrote :

Agreed. Done and force pushed. Here's the diff:

diff --git a/doc/STYLE.md b/doc/STYLE.md
index 373d3a1..36d9ee4 100644
--- a/doc/STYLE.md
+++ b/doc/STYLE.md
@@ -50,9 +50,9 @@
    this.

    If a bugfix comes with a test and the test can be arranged to work
- without its fix, then add the test first in an earlier commit,
- decorated with `@pytest.mark.xfail` or the `pytest.param`/`marks`
- equivalent.
+ without its fix, then a good technique is to add the test first in an
+ earlier commit, decorated with `@pytest.mark.xfail` or the
+ `pytest.param`/`marks` equivalent.

    Commits that cause previously fixed tests to pass (such as bugfix
    commits with a test added previously as above) should drop the xfail

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:2894c80181be3239908fd93d2919b46da0876b81
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/474/
Executed test runs:
    SUCCESS: VM Setup
    SUCCESS: Build
    SUCCESS: Unit Tests
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/474//rebuild

review: Approve (continuous-integration)
Revision history for this message
Robie Basak (racb) wrote :

FTR, I adopted Bryce's suggestion and Bryce gave me a +1 for my revised branch in standup yesterday.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/doc/STYLE.md b/doc/STYLE.md
2index d7ee95b..36d9ee4 100644
3--- a/doc/STYLE.md
4+++ b/doc/STYLE.md
5@@ -44,3 +44,24 @@
6 brought into the namespace.
7
8 * Keep imports sorted. This keeps diffs cleaner.
9+
10+ * Keep the test suite always passing and tests marked "xfail" always
11+ failing. We use CI and `xfail_strict=true` in `pytest.ini` to enforce
12+ this.
13+
14+ If a bugfix comes with a test and the test can be arranged to work
15+ without its fix, then a good technique is to add the test first in an
16+ earlier commit, decorated with `@pytest.mark.xfail` or the
17+ `pytest.param`/`marks` equivalent.
18+
19+ Commits that cause previously fixed tests to pass (such as bugfix
20+ commits with a test added previously as above) should drop the xfail
21+ at the same time.
22+
23+ In other words, where possible we use `xfail` to keep the test suite
24+ informed about known problems in the source tree at commit level
25+ granularity.
26+
27+ This helps the reviewer easily check the correctness of any tests
28+ being added, as well as their fixes. It also helps to keep CI "always
29+ green", making future bisection and other code archaeology easier.

Subscribers

People subscribed via source and target branches