~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/doc/buildd-mass-retry.txt

Undo rename. Again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Buildd-mass-retry behaviour
2
 
===========================
 
1
= Testing buildd-mass-retry behaviour =
3
2
 
4
 
    >>> import subprocess
5
 
    >>> import os
6
 
    >>> import sys
7
 
    >>> from canonical.config import config
 
3
  >>> import subprocess
 
4
  >>> import os
 
5
  >>> import sys
 
6
  >>> from canonical.config import config
8
7
 
9
8
'buildd-mass-retry' is a tool designed to retry a group of 'failed'
10
9
build records in a distroseries and/or architecture.
11
10
 
12
 
    >>> script = os.path.join(
13
 
    ...     config.root, "scripts", "ftpmaster-tools", "buildd-mass-retry.py")
 
11
  >>> script = os.path.join(config.root, "scripts", "ftpmaster-tools",
 
12
  ...                       "buildd-mass-retry.py")
14
13
 
15
14
The user can specify a distribution, a suite name (-s) and/or and
16
15
architecture (-a) as a build record provider, it will restrict the
30
29
 
31
30
Passing only suite, request retry on all failed states:
32
31
 
33
 
    >>> process = subprocess.Popen(
34
 
    ...     [sys.executable, script, "-v", "-NFDC", "-s", "hoary"],
35
 
    ...     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
36
 
    >>> stdout, stderr = process.communicate()
37
 
    >>> process.returncode
38
 
    0
39
 
    >>> print stderr
40
 
    INFO    Creating lockfile: ...
41
 
    INFO    Initializing Build Mass-Retry for
42
 
    'The Hoary Hedgehog Release/RELEASE'
43
 
    INFO    Processing builds in 'Failed to build'
44
 
    INFO    Processing builds in 'Dependency wait'
45
 
    INFO    Retrying i386 build of libstdc++ b8p in ubuntu hoary RELEASE (12)
46
 
    INFO    Processing builds in 'Chroot problem'
47
 
    INFO    Success.
48
 
    INFO    Dry-run.
49
 
    DEBUG   Removing lock file: ...
50
 
    <BLANKLINE>
 
32
  >>> process = subprocess.Popen([sys.executable, script, "-v", "-NFDC",
 
33
  ...                             "-s", "hoary"],
 
34
  ...                            stdout=subprocess.PIPE,
 
35
  ...                            stderr=subprocess.PIPE,)
 
36
  >>> stdout, stderr = process.communicate()
 
37
  >>> process.returncode
 
38
  0
 
39
  >>> print stderr
 
40
  DEBUG   Intitialising connection.
 
41
  INFO    Initializing Build Mass-Retry for 'The Hoary Hedgehog Release/RELEASE'
 
42
  INFO    Processing builds in 'Failed to build'
 
43
  INFO    Processing builds in 'Dependency wait'
 
44
  INFO    Retrying i386 build of libstdc++ b8p in ubuntu hoary RELEASE (12)
 
45
  INFO    Processing builds in 'Chroot problem'
 
46
  INFO    Success.
 
47
  INFO    Dry-run.
 
48
  <BLANKLINE>
51
49
 
52
50
Superseded builds won't be retried; buildd-manager will just skip the build
53
51
and set it to SUPERSEDED.
54
52
 
55
 
    >>> from zope.security.proxy import removeSecurityProxy
56
 
    >>> from lp.soyuz.interfaces.binarypackagebuild import (
57
 
    ...     IBinaryPackageBuildSet)
58
 
    >>> from lp.soyuz.enums import PackagePublishingStatus
59
 
    >>> build = getUtility(IBinaryPackageBuildSet).getByID(12)
60
 
    >>> pub = removeSecurityProxy(build.current_source_publication)
 
53
  >>> from zope.security.proxy import removeSecurityProxy
 
54
  >>> from lp.soyuz.interfaces.binarypackagebuild import (
 
55
  ...     IBinaryPackageBuildSet)
 
56
  >>> from lp.soyuz.enums import PackagePublishingStatus
 
57
  >>> build = getUtility(IBinaryPackageBuildSet).getByID(12)
 
58
  >>> pub = removeSecurityProxy(build.current_source_publication)
61
59
 
62
60
Let's mark the build from the previous run superseded.
63
61
 
64
 
    >>> pub.status = PackagePublishingStatus.SUPERSEDED
65
 
    >>> print build.current_source_publication
66
 
    None
67
 
    >>> transaction.commit()
 
62
  >>> pub.status = PackagePublishingStatus.SUPERSEDED
 
63
  >>> print build.current_source_publication
 
64
  None
 
65
  >>> transaction.commit()
68
66
 
69
67
A new run doesn't pick it up.
70
68
 
71
 
    >>> process = subprocess.Popen(
72
 
    ...     [sys.executable, script, "-v", "-NFDC", "-s", "hoary"],
73
 
    ...     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
74
 
    >>> stdout, stderr = process.communicate()
75
 
    >>> process.returncode
76
 
    0
77
 
    >>> print stderr
78
 
    INFO    Creating lockfile: ...
79
 
    INFO    Initializing Build Mass-Retry for
80
 
    'The Hoary Hedgehog Release/RELEASE'
81
 
    INFO    Processing builds in 'Failed to build'
82
 
    INFO    Processing builds in 'Dependency wait'
83
 
    DEBUG   Skipping superseded i386 build of libstdc++ b8p in
84
 
    ubuntu hoary RELEASE (12)
85
 
    INFO    Processing builds in 'Chroot problem'
86
 
    INFO    Success.
87
 
    INFO    Dry-run.
88
 
    DEBUG   Removing lock file: ...
89
 
    <BLANKLINE>
 
69
  >>> process = subprocess.Popen([sys.executable, script, "-v", "-NFDC",
 
70
  ...                             "-s", "hoary"],
 
71
  ...                            stdout=subprocess.PIPE,
 
72
  ...                            stderr=subprocess.PIPE,)
 
73
  >>> stdout, stderr = process.communicate()
 
74
  >>> process.returncode
 
75
  0
 
76
  >>> print stderr
 
77
  DEBUG   Intitialising connection.
 
78
  INFO    Initializing Build Mass-Retry for 'The Hoary Hedgehog Release/RELEASE'
 
79
  INFO    Processing builds in 'Failed to build'
 
80
  INFO    Processing builds in 'Dependency wait'
 
81
  DEBUG   Skipping superseded i386 build of libstdc++ b8p in ubuntu hoary RELEASE (12)
 
82
  INFO    Processing builds in 'Chroot problem'
 
83
  INFO    Success.
 
84
  INFO    Dry-run.
 
85
  <BLANKLINE>
90
86
 
91
 
    >>> pub.status = PackagePublishingStatus.PUBLISHED
92
 
    >>> transaction.commit()
 
87
  >>> pub.status = PackagePublishingStatus.PUBLISHED
 
88
  >>> transaction.commit()
93
89
 
94
90
Passing an architecture, which contains no failed build records,
95
91
nothing is done:
96
92
 
97
 
    >>> process = subprocess.Popen(
98
 
    ...     [
99
 
    ...         sys.executable, script,
100
 
    ...         "-v", "-NFDC", "-s", "hoary", "-a", "hppa",
101
 
    ...     ],
102
 
    ...     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
103
 
    >>> stdout, stderr = process.communicate()
104
 
    >>> process.returncode
105
 
    0
106
 
    >>> print stderr
107
 
    INFO    Creating lockfile: ...
108
 
    INFO    Initializing Build Mass-Retry for
109
 
    'The Hoary Hedgehog Release for hppa (hppa)/RELEASE'
110
 
    INFO    Processing builds in 'Failed to build'
111
 
    INFO    Processing builds in 'Dependency wait'
112
 
    INFO    Processing builds in 'Chroot problem'
113
 
    INFO    Success.
114
 
    INFO    Dry-run.
115
 
    DEBUG   Removing lock file: ...
116
 
    <BLANKLINE>
 
93
  >>> process = subprocess.Popen([sys.executable, script, "-v", "-NFDC",
 
94
  ...                             "-s", "hoary", "-a", "hppa"],
 
95
  ...                            stdout=subprocess.PIPE,
 
96
  ...                            stderr=subprocess.PIPE,)
 
97
  >>> stdout, stderr = process.communicate()
 
98
  >>> process.returncode
 
99
  0
 
100
  >>> print stderr
 
101
  DEBUG   Intitialising connection.
 
102
  INFO    Initializing Build Mass-Retry for 'The Hoary Hedgehog Release for hppa (hppa)/RELEASE'
 
103
  INFO    Processing builds in 'Failed to build'
 
104
  INFO    Processing builds in 'Dependency wait'
 
105
  INFO    Processing builds in 'Chroot problem'
 
106
  INFO    Success.
 
107
  INFO    Dry-run.
 
108
  <BLANKLINE>
117
109
 
118
110
 
119
111
Selecting only a specific failed state:
120
112
 
121
 
    >>> process = subprocess.Popen(
122
 
    ...     [sys.executable, script, "-v", "-NF", "-s", "hoary"],
123
 
    ...     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
124
 
    >>> stdout, stderr = process.communicate()
125
 
    >>> process.returncode
126
 
    0
127
 
    >>> print stderr
128
 
    INFO    Creating lockfile: ...
129
 
    INFO    Initializing Build Mass-Retry for
130
 
    'The Hoary Hedgehog Release/RELEASE'
131
 
    INFO    Processing builds in 'Failed to build'
132
 
    INFO    Success.
133
 
    INFO    Dry-run.
134
 
    DEBUG   Removing lock file: ...
135
 
    <BLANKLINE>
 
113
  >>> process = subprocess.Popen([sys.executable, script, "-v", "-NF",
 
114
  ...                             "-s", "hoary"],
 
115
  ...                            stdout=subprocess.PIPE,
 
116
  ...                            stderr=subprocess.PIPE,)
 
117
  >>> stdout, stderr = process.communicate()
 
118
  >>> process.returncode
 
119
  0
 
120
  >>> print stderr
 
121
  DEBUG   Intitialising connection.
 
122
  INFO    Initializing Build Mass-Retry for 'The Hoary Hedgehog Release/RELEASE'
 
123
  INFO    Processing builds in 'Failed to build'
 
124
  INFO    Success.
 
125
  INFO    Dry-run.
 
126
  <BLANKLINE>