
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
cdk-integ-runner-cwd-fix
Advanced tools
Fix the problem with CDK's integ-runner breaking the python path and current working directory.
When running integ-test on python, the CWD is set to the directory which contains your test file - not the directory which contains your cdk.json.
It also blows away the PYTHONPATH, so that no longer has your cdk project.
This means that your test file has no access to the stacks you create, and you get a lot of ModuleNotFoundError when you try to import your stacks into the test case.
It also breaks the lambda (and likely other) builds which rely on a path. So,
If you're using Code.from_asset("./lambda")
you should start using
Code.from_asset(f"{os.getcwd()}/lambda")
instead, after using this fix.
This is likely to be applicable to other constructs that rely on a relative path.
This is a workaround to fix the CWD and PYTHONPATH so that your test file can import your stacks and run the integ tests.
pip install cdk-integ-runner-cwd-fix
Then, in your test file, add the following lines:
from cdk_integ_runner_cwd_fix import fix_cwd
fix_cwd()
# You can now import your stack
from my_cdk_project.my_stack import MyStack
# And write your test code here
app = cdk.App()
stack = MyStack(app, "TestStack")
app.synth()
You'll need to set the project path in the environment variable CDK_INTEG_RUNNER_CWD
:
The below will set it to your current directory - which is likely to be what you need:
export CDK_INTEG_RUNNER_CWD=$(pwd)
or to be explicit, or to set it to something other than the path you're currently in:
export CDK_INTEG_RUNNER_CWD=/path/to/your/cdk/project
Then, run your tests as usual:
integ-runner
FAQs
Fix the problem with CDK's integ-runner breaking the python path and current working directory.
We found that cdk-integ-runner-cwd-fix demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.