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

Ensure Rails testing is considered a development environment #3062

Merged
merged 8 commits into from
Sep 19, 2023

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Aug 18, 2023

What does this PR do?

This PR detects if a Rails application is running in development or test mode, and uses this information to inform ddtrace internally in order improve logging and background worker management.

Motivation

Currently, we consider local development Rails console as a production environment, which is incorrect.

Additional Notes

This checking ensures staging, which is a common non-stardard Rails environment is considered "not development" by ddtrace.

How to test the change?

There are unit test covering this change.

@marcotc marcotc self-assigned this Aug 29, 2023
Copy link
Member

@anmarchenko anmarchenko left a comment

Choose a reason for hiding this comment

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

I think we need to go forward with that because there are still issues with telemetry and RC being reported.

Do you think we would need to add a check for Cucumber in test? method?

sig/datadog/core/environment/execution.rbs Outdated Show resolved Hide resolved
@marcotc marcotc marked this pull request as ready for review September 19, 2023 20:10
@marcotc marcotc requested a review from a team September 19, 2023 20:10
@marcotc
Copy link
Member Author

marcotc commented Sep 19, 2023

Do you think we would need to add a check for Cucumber in test? method?

That's a good idea, I'll open a separate PR.

@codecov-commenter
Copy link

Codecov Report

Merging #3062 (f648160) into master (74cb196) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3062   +/-   ##
=======================================
  Coverage   98.16%   98.16%           
=======================================
  Files        1283     1283           
  Lines       73898    73918   +20     
  Branches     3421     3421           
=======================================
+ Hits        72542    72565   +23     
+ Misses       1356     1353    -3     
Files Changed Coverage Δ
lib/datadog/core/environment/execution.rb 100.00% <100.00%> (ø)
spec/datadog/core/environment/execution_spec.rb 96.11% <100.00%> (+0.66%) ⬆️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@marcotc marcotc merged commit ff32e13 into master Sep 19, 2023
217 checks passed
@marcotc marcotc deleted the rails-test-detect branch September 19, 2023 21:16
@github-actions github-actions bot added this to the 1.15.0 milestone Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants