Skip to content

Commit fbfa21b

Browse files
authored
Merge pull request #1030 from cderici/build-test-and-issue-template
#1030 #### Description This does two things: 1. Adds a Makefile target called `build-test` that runs the `setup.py sdist` and installs the artifact in a virtual environment and runs a very simple command on it. The purpose of this is to catch the build and runtime dependency problems early on whenever a change is made that'll effect the release down the road (i.e. before it blows up when a new version is released). We add it into a GH action job as well to automatically catch these issues. For example, having something like this would've saved us from hitting #1025 on the `3.3.1.0` release, which is the sole reason we had to make a new release https://github.com/juju/python-libjuju/releases/tag/3.3.1.1 afterwards. 2. Updates the bug report template and adds `Please provide a simplified reproducer, and if it's possible please refrain from providing a "clone this repository and run the integration tests to see the problem" type of a reproducer. Thanks!`, which is pretty self-explanatory. #### QA Steps Just running the make target to see if it succeeds locally should be sufficient to QA this: ``` make build-test ``` And maybe some manual checking for typos in the template message (b/c user-facing) could help.
2 parents f0f0ba1 + 8d9ee91 commit fbfa21b

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

.github/ISSUE_TEMPLATE/BugReport.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ body:
4848
id: info
4949
attributes:
5050
label: "Reproduce / Test"
51-
description: "Please add valid Python code to reproduce the bug. This will be used as a test for QAing later on."
51+
description: "Please add valid Python code to reproduce the bug. This will be used as a test for QAing later on.
52+
53+
Please provide a simplified reproducer, and if it's possible please refrain from providing a "clone this repository and run the integration tests to see the problem" type of a reproducer. Thanks!"
5254
render: python
5355
validations:
5456
required: true

.github/workflows/test.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ jobs:
2525
tox -e lint
2626
./scripts/copyright.sh
2727
28+
build-test:
29+
name: Build test
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
python:
34+
- "3.10"
35+
steps:
36+
- name: Check out code
37+
uses: actions/checkout@v3
38+
- name: Setup Python
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python }}
42+
- name: Run build test target
43+
run: |
44+
make build-test
45+
2846
unit-tests:
2947
needs: lint
3048
name: Unit tests

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
BIN := .tox/py3/bin
22
PY := $(BIN)/python3
33
PIP := $(BIN)/pip3
4-
VERSION := $(shell $(PY) -c "from juju.version import CLIENT_VERSION; print(CLIENT_VERSION)")
4+
VERSION := $(shell python3 -c "from juju.version import CLIENT_VERSION; print(CLIENT_VERSION)")
55

66
.PHONY: clean
77
clean:
@@ -40,6 +40,16 @@ lint:
4040
docs:
4141
tox -e docs
4242

43+
.PHONY: build-test
44+
build-test:
45+
rm -rf venv
46+
python3 -m venv venv
47+
. venv/bin/activate
48+
python3 setup.py sdist
49+
pip install ./dist/juju-${VERSION}.tar.gz
50+
python3 -c "from juju.controller import Controller"
51+
rm ./dist/juju-${VERSION}.tar.gz
52+
4353
.PHONY: release
4454
release:
4555
git fetch --tags

0 commit comments

Comments
 (0)