-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test individual product loading (#3738)
Tests that each product can be loaded by itself, and repairs appsec to be loadable without tracing having already been loaded.
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'shellwords' | ||
|
||
REQUIRES = { | ||
'datadog/appsec' => 'Datadog::AppSec', | ||
'datadog/core' => 'Datadog::Core', | ||
'datadog/kit' => 'Datadog::Kit', | ||
'datadog/profiling' => 'Datadog::Profiling', | ||
'datadog/tracing' => 'Datadog::Tracing', | ||
}.freeze | ||
|
||
RSpec.describe 'loading of products' do | ||
REQUIRES.each do |req, const| | ||
context req do | ||
let(:code) do | ||
<<-E | ||
if defined?(Datadog) | ||
unless Datadog.constants == [:VERSION] | ||
exit 1 | ||
end | ||
end | ||
require "#{req}" | ||
unless defined?(#{const}) | ||
exit 1 | ||
end | ||
exit 0 | ||
E | ||
end | ||
|
||
it 'loads successfully by itself' do | ||
rv = system("ruby -e #{Shellwords.shellescape(code)}") | ||
expect(rv).to be true | ||
end | ||
end | ||
end | ||
end |