Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add environment variable interpolation to YAML script parser #226

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

georgezlei
Copy link

Add YAML Configuration Parser with Environment Variable Support

Environment variable interpolation is very useful when sensitive data, such as user passwords and other PII data is used in the test. This PR introduced a {{VAR_NAME}} syntax in the YAML script to interpolate the environment variables.

Changes

  • Implemented environment variable interpolation in YAML configuration parser.
  • Added unit tests for YAML utilities including building, parsing, and flow item brief generation

Features

  • Environment variable interpolation using {{VAR_NAME}} syntax
  • Throws descriptive errors for undefined environment variables

Testing

Added test suite covering:

  • Environment variable interpolation
  • Error handling for undefined variables

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

netlify bot commented Dec 31, 2024

Deploy Preview for midscene ready!

Name Link
🔨 Latest commit e4a4836
🔍 Latest deploy log https://app.netlify.com/sites/midscene/deploys/677355d601658c0008c20a5b
😎 Deploy Preview https://deploy-preview-226--midscene.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@yuyutaotao
Copy link
Collaborator

Hi @georgezlei

Great job !

How about we replace the {{var_name}} syntax to the ${var_name} syntax? The ${var_name} syntax looks tidier and similar to the JavaScript template string syntax.

And remember to sign the CLA in this PR .

@yuyutaotao yuyutaotao self-requested a review December 31, 2024 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants