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

add linux CI #4444

Merged
merged 14 commits into from
Dec 17, 2020
Merged

add linux CI #4444

merged 14 commits into from
Dec 17, 2020

Conversation

jmarolf
Copy link
Contributor

@jmarolf jmarolf commented Nov 20, 2020

No description provided.

@jmarolf jmarolf requested a review from a team as a code owner November 20, 2020 04:49
@jmarolf jmarolf force-pushed the infrastructure/add-linux-build branch from a2353ad to 5443b2a Compare November 20, 2020 04:54
@codecov
Copy link

codecov bot commented Nov 20, 2020

Codecov Report

Merging #4444 (a4bf6dd) into master (46c1e52) will decrease coverage by 0.01%.
The diff coverage is 76.00%.

@@            Coverage Diff             @@
##           master    #4444      +/-   ##
==========================================
- Coverage   95.85%   95.84%   -0.02%     
==========================================
  Files        1179     1182       +3     
  Lines      268733   268752      +19     
  Branches    16224    16226       +2     
==========================================
- Hits       257607   257575      -32     
- Misses       9062     9104      +42     
- Partials     2064     2073       +9     

@jmarolf
Copy link
Contributor Author

jmarolf commented Nov 20, 2020

@mavasani looking at the test results it appears e have some tests that rely on windows style paths

@mavasani mavasani mentioned this pull request Nov 20, 2020
@omajid
Copy link
Member

omajid commented Nov 20, 2020

Fixing some hardcoded windows paths makes the tests run work much better for me:

diff --git a/src/Test.Utilities/CSharpCodeFixVerifier`2+Test.cs b/src/Test.Utilities/CSharpCodeFixVerifier`2+Test.cs
index 23b6ec5e4..f8d221d5a 100644
--- a/src/Test.Utilities/CSharpCodeFixVerifier`2+Test.cs
+++ b/src/Test.Utilities/CSharpCodeFixVerifier`2+Test.cs
@@ -55,7 +55,7 @@ public Test()
                             DocumentId.CreateNewId(projectId, debugName: ".editorconfig"),
                             ".editorconfig",
                             SourceText.From($"is_global = true" + Environment.NewLine + AnalyzerConfigDocument),
-                            filePath: @"z:\.editorconfig");
+                            filePath: @"/tmp/.editorconfig");
                     }
 
                     return solution;
diff --git a/src/Test.Utilities/VisualBasicCodeFixVerifier`2+Test.cs b/src/Test.Utilities/VisualBasicCodeFixVerifier`2+Test.cs
index 6c0074678..1c76fcd64 100644
--- a/src/Test.Utilities/VisualBasicCodeFixVerifier`2+Test.cs
+++ b/src/Test.Utilities/VisualBasicCodeFixVerifier`2+Test.cs
@@ -33,7 +33,7 @@ public Test()
                             DocumentId.CreateNewId(projectId, debugName: ".editorconfig"),
                             ".editorconfig",
                             SourceText.From($"is_global = true" + Environment.NewLine + AnalyzerConfigDocument),
-                            filePath: @"z:\.editorconfig");
+                            filePath: @"/tmp/.editorconfig");
                     }
 
                     return solution;

The paths should be conditionalized correctly based on OS.

Another set of failures is based on assuming the newlines in the file are always \r\n. On Linux, line-endings are \n. Some files are written to disk (and get \n line-endings) then the test fails because it expects \r\n. This seems to work:

diff --git a/src/PublicApiAnalyzers/UnitTests/DeclarePublicApiAnalyzerTests.cs b/src/PublicApiAnalyzers/UnitTests/DeclarePublicApiAnalyzerTests.cs
index 6b943c43e..191b4014e 100644
--- a/src/PublicApiAnalyzers/UnitTests/DeclarePublicApiAnalyzerTests.cs
+++ b/src/PublicApiAnalyzers/UnitTests/DeclarePublicApiAnalyzerTests.cs
@@ -2094,6 +2094,8 @@ public class {|RS0016:{|RS0016:C2|}|} { }
         [InlineData("\r\n\r\n", "\r\n")]
         public async Task TestPreserveTrailingNewline(string originalEndOfFile, string expectedEndOfFile)
         {
+            originalEndOfFile = originalEndOfFile.Replace("\r\n", Environment.NewLine, StringComparison.Ordinal);
+            expectedEndOfFile = expectedEndOfFile.Replace("\r\n", Environment.NewLine, StringComparison.Ordinal);
             var source = @"
 public class C
 {

@runfoapp runfoapp bot mentioned this pull request Nov 20, 2020
@jmarolf jmarolf force-pushed the infrastructure/add-linux-build branch from ea39dba to f832c7f Compare November 20, 2020 23:48
@mavasani
Copy link
Contributor

@jmarolf Are you blocked here?

@jmarolf jmarolf force-pushed the infrastructure/add-linux-build branch from 28b3100 to 8e8bc64 Compare December 17, 2020 00:29
@jmarolf jmarolf force-pushed the infrastructure/add-linux-build branch from e05eb97 to fd67909 Compare December 17, 2020 00:47
@jmarolf jmarolf merged commit b37ca50 into master Dec 17, 2020
@jmarolf jmarolf deleted the infrastructure/add-linux-build branch December 17, 2020 02:17
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.

3 participants