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

Allow setting environment variable in csharp_test #441

Closed
titusfortner opened this issue Jun 6, 2024 · 2 comments
Closed

Allow setting environment variable in csharp_test #441

titusfortner opened this issue Jun 6, 2024 · 2 comments

Comments

@titusfortner
Copy link

I'm looking to create a set of targets that toggle on a feature. In my test code I have it set to toggle based on the presence of an Environment variable. If you can add an env attribute to pass it in, that would be very helpful.

I'm not certain the right syntax, but based on what I have working in rules_ruby, I think it would look like:

                csharp_test(
                    name = bidi_test_name,
                    srcs = lib_srcs + [src] + ["@rules_dotnet//dotnet/private/rules/common/nunit:shim.cs"],
                    deps = deps + extra_deps,
                    env =  {"WEBDRIVER_BIDI": "true"},
                    target_frameworks = target_frameworks,
                    args = _BROWSERS[browser]["args"] + _HEADLESS_ARGS,
                    data = data + _BROWSERS[browser]["data"],
                    tags = tags + [browser] + COMMON_TAGS + _BROWSERS[browser]["tags"],
                    size = size,
                    **kwargs
                )
                tests.append(bidi_test_name)
@purkhusid
Copy link
Collaborator

This is a reasonable request, I'll see if I can add it when I have time.

@purkhusid
Copy link
Collaborator

This is now available on master. Will be cutting a new release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants