Skip to content

Commit

Permalink
sanity_checks: Verify releases.json has been updated
Browse files Browse the repository at this point in the history
  • Loading branch information
xclaesse authored and eli-schwartz committed Aug 9, 2023
1 parent 25371fd commit a18f699
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/sanity_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def check_meson_version(self, name: str, version: str, patch_path: str, builddir
self.assertEqual(subproject['version'], version)

def test_releases(self):
has_new_releases = False
for name, info in self.releases.items():
with self.subTest(name=name):
# We do extra checks in the case a new release is being made. This
Expand Down Expand Up @@ -247,6 +248,7 @@ def test_releases(self):
self.check_source_url(name, wrap_section, ver)
if i == 0 and t not in self.tags:
with self.subTest(step='check_new_release'):
has_new_releases = True
self.check_new_release(name, deps=deps, progs=progs)
with self.subTest(f'If this works now, please remove it from broken_{platform.system().lower()}!'):
self.assertNotIn(name, self.skip)
Expand All @@ -255,6 +257,13 @@ def test_releases(self):
with self.subTest(step='version is tagged'):
self.assertIn(t, self.tags)

with self.subTest(step='releases.json updated'):
if not has_new_releases:
last_tag = subprocess.check_output(['git', 'describe', '--tags', '--abbrev=0'], text=True, encoding='utf-8').strip()
changed_files = subprocess.check_output(['git', 'diff', '--name-only', 'HEAD', last_tag], text=True, encoding='utf-8').splitlines()
if any(f.startswith('subprojects') for f in changed_files):
self.fail('Subprojects files changed but no new release added into releases.json')

@unittest.skipUnless('TEST_BUILD_ALL' in os.environ, 'Run manually only')
def test_build_all(self):
passed = []
Expand Down

0 comments on commit a18f699

Please sign in to comment.