File tree 1 file changed +8
-3
lines changed 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,14 @@ def _create_temp_cdk_app(self):
195
195
196
196
This allows us to keep our BaseInfrastructure while supporting context lookups.
197
197
"""
198
- # tests.e2e.tracer.infrastructure
198
+ # cdk.out/tracer/cdk_app_v39.py
199
+ temp_file = self ._cdk_out_dir / f"cdk_app_{ PYTHON_RUNTIME_VERSION } .py"
200
+
201
+ if temp_file .exists ():
202
+ # no need to regenerate CDK app since it's just boilerplate
203
+ return temp_file
204
+
205
+ # Convert from POSIX path to Python module: tests.e2e.tracer.infrastructure
199
206
infra_module = str (self ._feature_infra_module_path .relative_to (SOURCE_CODE_ROOT_PATH )).replace (os .sep , "." )
200
207
201
208
code = f"""
@@ -208,8 +215,6 @@ def _create_temp_cdk_app(self):
208
215
if not self ._cdk_out_dir .is_dir ():
209
216
self ._cdk_out_dir .mkdir (parents = True , exist_ok = True )
210
217
211
- # cdk.out/tracer/cdk_app_v39.py
212
- temp_file = self ._cdk_out_dir / f"cdk_app_{ PYTHON_RUNTIME_VERSION } .py"
213
218
with temp_file .open ("w" ) as fd :
214
219
fd .write (textwrap .dedent (code ))
215
220
You can’t perform that action at this time.
0 commit comments