-
Notifications
You must be signed in to change notification settings - Fork 100
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
[POC] Add native tests #201
Conversation
@@ -9,6 +9,8 @@ class CLRHelperTest : public ::CLRHelperTestBase {}; | |||
|
|||
TEST_F(CLRHelperTest, EnumeratesTypeDefs) { | |||
std::vector<std::wstring> expected_types = { | |||
L"Microsoft.CodeAnalysis.EmbeddedAttribute", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pjanotti Any idea what required these additional attributes? At first I thought it's GlobalSuppressions.cs, but then the solution already references linked solution level GlobalSuppressions. + Something turned on code analysis for dependency samples that wasn't required in previous commit.
CC - @pellared @dszmigielski
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the namespace this is an attribute type added by Roslyn, but I don't know its purpose. Can you point me to the commit in which wasn't required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RassK from a quick check that attribute is added to netstandard1.0 and netstandard2.0 assemblies - I'm not sure but perhaps this was not added with some older version of Roslyn. Another possibility is that they were always there but the test didn't error when they were not listed (although the macro seems to imply equality).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lot of code, but I would love to have it merged ASAP. There is so much overlap on my task with what you have already done in terms of nuke setup, that doing that once again is just waste of time. If something is missing/wrong we can work on improving that along the way, but at least all of us would work on the same base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed code related to Nuke.
I still need to review everything under test
path
@@ -0,0 +1,62 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rewritte this logic to Nuke?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, that's the second Todo after managed layer is nuked.
test/Datadog.Trace.ClrProfiler.Native.Tests/Datadog.Trace.ClrProfiler.Native.Tests.vcxproj
Outdated
Show resolved
Hide resolved
test/test-applications/instrumentation/dependency-libs/Samples.ExampleLibrary/Class1.cs
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,44 @@ | |||
# ------------------------------------------------------------------------------ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to add a target with executes git diff --exit-code
to ensure that someone has not forgotten to commit the autogenerated code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great idea, I think it can be a task of it's own. Will add to todo.
To build using specific target run: | ||
|
||
```cmd | ||
dotnet nuke --target TargetNameHere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS. dotnet nuke TargetNameHere
works as well and this is what I use from commandline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about changing cmd line to:
dotnet nuke [--target] TargetNameHere
Wondering if it's understandable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 For me the output of dotnet nuke help
is enough and I do not need this fragment 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is "TargetNameHere" I think that the optional parameter doesn't add value.
@@ -0,0 +1,7 @@ | |||
:; set -eo pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines seem like a left-over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is some kind of hack to make .cmd
work on Linux and MacOS. I do not know how it works... But I think it does 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic 😮 - I needed to chmod it to try it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On MacOS it also builds a bunch of files that are not ignored. @RassK could check if the .gitignore needs some updates?
@@ -9,6 +9,8 @@ class CLRHelperTest : public ::CLRHelperTestBase {}; | |||
|
|||
TEST_F(CLRHelperTest, EnumeratesTypeDefs) { | |||
std::vector<std::wstring> expected_types = { | |||
L"Microsoft.CodeAnalysis.EmbeddedAttribute", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the namespace this is an attribute type added by Roslyn, but I don't know its purpose. Can you point me to the commit in which wasn't required?
Any thoughts about this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is a state that is worth merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@RassK @pellared we really should look into that but more related to instrumentations (there are some challenges but it should be possible). |
Adds native tests & CI support (GH Actions). Building via Nuke.
What's next:
git diff --exit-code
target)