Skip to content

Commit 123e57d

Browse files
authored
Add a short guide to testing changes locally (#607)
1 parent 7f1e4c5 commit 123e57d

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ buildbot/
66
lib/
77
venv/
88
worker/
9+
settings.yaml

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,44 @@ characters), for example using KeePassX.
6464
* Restart the buildbot server: `make restart-master`
6565

6666
Documentation: http://docs.buildbot.net/current/manual/configuration/workers.html#defining-workers
67+
68+
## Testing changes locally
69+
70+
To test a change to the buildbot code locally, a worker is needed to run jobs.
71+
First create a `settings.yaml` file in the repository root. The settings file controls
72+
how the Builbot master should connect to workers. The simplest setup runs a worker in the
73+
same process as the Buildbot master on the local machine. The local environment must have any
74+
required dependencies for that worker environment. With the settings file created run:
75+
76+
```bash
77+
export PYBUILDBOT_SETTINGS_PATH=$(pwd)/settings.yaml
78+
```
79+
80+
Then, update the settings file to include the following:
81+
82+
```yaml
83+
# Use a local in-process worker
84+
use_local_worker: true
85+
# Use one of the buildfactories found in master/custom/factories.py.
86+
# Here we use the WASI cross build factory. If unspecified, the default
87+
# is to use the UnixBuild factory
88+
local_worker_buildfactory: "Wasm32WasiCrossBuild"
89+
```
90+
91+
Then run
92+
93+
```
94+
make update-master
95+
```
96+
97+
This updates the state database and starts the buildbot master.
98+
You can now open http://localhost:9011/ and use the local Buildbot master web UI.
99+
Under Builds -> Builders there should be one or more builders for the factory
100+
that was configured. After clicking on the relevant builder, clicking on the "force"
101+
button in the upper right corner will start a new build.
102+
103+
Finally, the master can be stopped when no longer needed by running
104+
105+
```
106+
make stop-master
107+
```

0 commit comments

Comments
 (0)