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: added support for inherited_environment in scala_test rule #1401

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

omerlh
Copy link
Contributor

@omerlh omerlh commented Jun 1, 2022

Description

Added support for inherited_environment in scala_test rule

Follow up on this slack thread I added support for the new inherited_environment to scala_test.
This feature requires Bazel version 5.2 rc0 or higher.

Motivation

While Bazel run tests in isolated environments, when running integration tests there is a need to pass env vars to the tested code - for example, credentials for external systems like databases. This PR added a new flag that is already supported by Bazel.

Note: I am a total noob. I got a lot of help on Slack in order to get to this point but I am not 100% understand everything I changed 🤦 I added a test so I know it is working, I will be helping to have some guidelines on how to run it only on Bazel 5.2:

  • Passing a flag to test_rules_scala and let it know it should run this test?
  • Add another shell file running only my test?
  • Other option?

Also - where and how should I document it?

@omerlh omerlh requested review from liucijus and simuons as code owners June 1, 2022 11:22
@omerlh omerlh force-pushed the feat/inherited_environment branch from 858e7dd to 2f3cec9 Compare June 1, 2022 11:23
scala/private/rules/scala_test.bzl Outdated Show resolved Hide resolved
scala/private/phases/phase_test_environment.bzl Outdated Show resolved Hide resolved
@omerlh omerlh force-pushed the feat/inherited_environment branch 7 times, most recently from f6e741d to 8b06303 Compare June 2, 2022 07:33
.bazelci/presubmit.yml Outdated Show resolved Hide resolved
@omerlh omerlh force-pushed the feat/inherited_environment branch from 8b06303 to c8b3982 Compare June 2, 2022 11:59
@omerlh omerlh force-pushed the feat/inherited_environment branch from c8b3982 to ae09a02 Compare June 2, 2022 12:00
Copy link
Collaborator

@liucijus liucijus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @omerlh!

Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @omerlh and sorry for delay

@simuons simuons merged commit 94fdc81 into bazelbuild:master Jun 6, 2022
@omerlh omerlh deleted the feat/inherited_environment branch June 8, 2022 05:39
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

Successfully merging this pull request may close these issues.

4 participants