Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-08 08:36:30

0001 """Offline checks of upstream packaging; no network, builds or submissions."""
0002 from pathlib import Path
0003 import unittest
0004 
0005 ROOT = Path(__file__).resolve().parents[2]
0006 
0007 
0008 class UpstreamPackagingTests(unittest.TestCase):
0009     def test_bootstrap_defaults_to_upstream_main(self):
0010         text = (ROOT/'tools/bootstrap-yall-integration.sh').read_text()
0011         self.assertIn('LFHCAL_REPO_URL=${LFHCAL_REPO_URL:-"https://github.com/eic/epic-lfhcal-tbana.git"}', text)
0012         self.assertIn('LFHCAL_BRANCH=${LFHCAL_BRANCH:-main}', text)
0013         self.assertNotIn('LFHCAL_BRANCH=${LFHCAL_BRANCH:-yall-integration}', text)
0014 
0015     def test_review_setup_explicitly_overrides_both_repo_and_branch(self):
0016         text = (ROOT/'examples/yall/SETUP.md').read_text()
0017         self.assertIn('env LFHCAL_REPO_URL=https://github.com/paulnord/epic-lfhcal-tbana.git LFHCAL_BRANCH=yall-integration-upstream bash', text)
0018         self.assertIn('After upstream merges this contribution', text)
0019         self.assertNotIn('raw.githubusercontent.com/paulnord/epic-lfhcal-tbana/yall-integration/', text)
0020 
0021     def test_main_readme_links_to_existing_guides(self):
0022         text = (ROOT/'README.md').read_text()
0023         for name in ('QUICKSTART.md', 'SETUP.md', 'README.md'):
0024             path = 'examples/yall/'+name
0025             self.assertIn('('+path+')', text)
0026             self.assertTrue((ROOT/path).is_file())
0027 
0028     def test_existing_installation_does_not_require_bootstrap(self):
0029         text = (ROOT/'examples/yall/QUICKSTART.md').read_text()
0030         self.assertIn('do not run the bootstrap just to submit', text)
0031         self.assertIn('There are\nno build tasks in these example graphs.', text)
0032         self.assertIn('do **not** source `env.tcsh`', text)
0033 
0034 
0035 if __name__ == '__main__':
0036     unittest.main()