-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create more tests on branches and recipes #679
Conversation
7ac11a4
to
9a4262b
Compare
9a4262b
to
f24f70e
Compare
tox -c tests/branch_management -e integration | ||
tox -c tests/branch_management -e test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooof! We weren't running these tests!
deps = | ||
-r {tox_root}/requirements-test.txt | ||
commands = | ||
pytest -v \ | ||
--maxfail 1 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cmon, let's see all the failures. Don't stop for just one
with: | ||
fetch-depth: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets see all the branches (so we can check that certain branches exist)
@functools.lru_cache | ||
def _confirm_branch_exists(repo, branch): | ||
log.info(f"Checking {branch} branch exists in {repo}") | ||
cmd = f"git ls-remote --heads {repo} {branch}" | ||
output = _sh(cmd.split()) | ||
return branch in output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the branches shouldn't be changing while we're checking them. lets cache the results
@functools.lru_cache | ||
def _confirm_recipe_exist(track, flavour): | ||
recipe = f"https://launchpad.net/~containers/k8s/+snap/k8s-snap-{track}-{flavour}" | ||
r = requests.get(recipe) | ||
return r.status_code == 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for the lp_recipes,
the recipes shouldn't be changing while we're checking them. lets cache the results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @addyess
A couple of comments but I like where this is going already.
by the respective LP builders for building the v1.11.y. | ||
This is to ensure that the prior release branches exist in the k8s-snap repository | ||
before we can proceed to build the next release. For example, if the current stable | ||
k8s release is v1.31.0, there must be a release-1.30 branch before updating main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if we explicitly don't want a release for a specific flavor? Maybe moonray should not have a 1.32 release (for whatever reason). Will this break all releases/checks for this flavor going forward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_confirm_all_branches_exist
tests that all the flavors have a branch for given release channel.
If 1.XX
release doesn't have a build-scripts/patches/foo-bunny
, then it wont look for a autoupdate/release-1.XX-foo-bunny
The intent of this test is to block the component upgrade PR from running on the main branch and updating kubernetes to 1.(XX+1)
if there is not yet a branch for 1.XX
and all the flavors of 1.XX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* Create more tests on branches and recipes * Apply review comments
Overview
Details
depth:0
so it can "see" all the remote branches