Use constants for commonly used test easyconfig folders, files and content - #5203
Use constants for commonly used test easyconfig folders, files and content#5203Flamefire wants to merge 1 commit into
Conversation
|
Yikes, this is pretty big... @Flamefire Maybe we should more gradually adopt these constants, for example only update a single test module to use them, and then gradually work towards doing so in all test modules? Otherwise this is going to be a nightmare to review... |
|
This is mostly a search & replace but in multiple steps. E.g. - test_ecs = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs')
- toy_ec = os.path.join(test_ecs, 't', 'toy', 'toy-0.0.eb')
- use toy_ec
+ use TOY_EC
Doing it gradually is not useful: Once the patterns are identified just search/replace over the test folder. If any tests fail revisit the pattern. This way we catch all instances and verify them. The risk is low as it changes tests only (except for the 2 trivial changes to support - test_ecs_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'test_ecs')
- ec_file = os.path.join(test_ecs_dir, 'f', 'foss', 'foss-2018a.eb')
+ ec_file = os.path.join(TEST_ECS_DIR, 'f', 'foss', 'foss-2018a.eb')
ec = EasyConfig(ec_file)
self.assertEqual(ec.dependency_names(), {'FFTW', 'GCC', 'OpenBLAS', 'OpenMPI', 'ScaLAPACK'})
build_options = {
'external_modules_metadata': ConfigObj(),
'minimal_toolchains': True,
- 'robot_path': [test_ecs_dir],
+ 'robot_path': [TEST_ECS_DIR],I'd say it would be enough to just scroll over the changes and do only random spot checks. |
Followup to #5050