File tree Expand file tree Collapse file tree 3 files changed +10
-25
lines changed Expand file tree Collapse file tree 3 files changed +10
-25
lines changed Original file line number Diff line number Diff line change @@ -154,14 +154,7 @@ def _emit_script(job):
154154def detect_topology ():
155155 rt = runtime ()
156156 detect_remote_systems = rt .get_option ('general/0/remote_detect' )
157- config_file = rt .site_config .filename
158- if config_file == '<builtin>' :
159- config_prefix = os .path .join (
160- os .getenv ('HOME' ), '.reframe/topology'
161- )
162- else :
163- config_prefix = os .path .join (os .path .dirname (config_file ), '_meta' )
164-
157+ topo_prefix = os .path .join (os .getenv ('HOME' ), '.reframe/topology' )
165158 for part in rt .system .partitions :
166159 getlogger ().debug (f'detecting topology info for { part .fullname } ' )
167160 found_procinfo = False
@@ -184,10 +177,10 @@ def detect_topology():
184177 continue
185178
186179 topo_file = os .path .join (
187- config_prefix , f'{ rt .system .name } -{ part .name } ' , 'processor.json'
180+ topo_prefix , f'{ rt .system .name } -{ part .name } ' , 'processor.json'
188181 )
189182 dev_file = os .path .join (
190- config_prefix , f'{ rt .system .name } -{ part .name } ' , 'devices.json'
183+ topo_prefix , f'{ rt .system .name } -{ part .name } ' , 'devices.json'
191184 )
192185 if not found_procinfo and os .path .exists (topo_file ):
193186 getlogger ().debug (
Original file line number Diff line number Diff line change 66import json
77import os
88import pytest
9- import shutil
109
1110
1211from reframe .core .runtime import runtime
1514
1615
1716@pytest .fixture
18- def exec_ctx (make_exec_ctx_g , tmp_path ):
19- # Copy the default settings to the temp dir
20- config_file = tmp_path / 'conf.py'
21- shutil .copy ('reframe/core/settings.py' , config_file )
17+ def exec_ctx (make_exec_ctx_g , tmp_path , monkeypatch ):
18+ # Monkey-patch HOME, since topology is always written there
19+ monkeypatch .setenv ('HOME' , str (tmp_path ))
2220
2321 # Create a devices file manually, since it is not auto-generated
24- meta_prefix = tmp_path / '_meta ' / 'generic-default'
22+ meta_prefix = tmp_path / '.reframe' / 'topology ' / 'generic-default'
2523 os .makedirs (meta_prefix )
2624 with open (meta_prefix / 'devices.json' , 'w' ) as fp :
2725 json .dump ([
@@ -32,7 +30,7 @@ def exec_ctx(make_exec_ctx_g, tmp_path):
3230 }
3331 ], fp )
3432
35- yield from make_exec_ctx_g (config_file )
33+ yield from make_exec_ctx_g ()
3634
3735
3836def test_autotect (exec_ctx ):
Original file line number Diff line number Diff line change 1010import os
1111import pytest
1212import re
13- import shutil
1413import sys
1514
1615import reframe .core .environments as env
@@ -54,13 +53,7 @@ def perflogdir(tmp_path):
5453
5554
5655@pytest .fixture
57- def rm_config_meta ():
58- yield
59- shutil .rmtree ('unittests/resources/_meta' , ignore_errors = True )
60-
61-
62- @pytest .fixture
63- def run_reframe (tmp_path , perflogdir , rm_config_meta ):
56+ def run_reframe (tmp_path , perflogdir , monkeypatch ):
6457 def _run_reframe (system = 'generic:default' ,
6558 checkpath = ['unittests/resources/checks/hellocheck.py' ],
6659 environs = ['builtin' ],
@@ -113,6 +106,7 @@ def _run_reframe(system='generic:default',
113106
114107 return run_command_inline (argv , cli .main )
115108
109+ monkeypatch .setenv ('HOME' , str (tmp_path ))
116110 return _run_reframe
117111
118112
You can’t perform that action at this time.
0 commit comments