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

test: fix tests #6

Merged
merged 13 commits into from
Jul 17, 2024
Merged

test: fix tests #6

merged 13 commits into from
Jul 17, 2024

Conversation

miquelbeltran
Copy link
Contributor

@miquelbeltran miquelbeltran commented Jul 15, 2024

Test were broken for several reasons, some fixes required changing the client code, some fixing the test setup.

Besides, I need to check how to fix the code formatting with some rules, so it doesn't change each time I modify a file.

@miquelbeltran miquelbeltran requested review from a team, nikz, TheRealAgentK and sumitramanga and removed request for a team July 15, 2024 10:16
@@ -191,7 +191,7 @@ internal EnvironmentDetails(BrowserSpecs specs, BrowserStats stats)
DeviceName = !string.IsNullOrWhiteSpace(specs.DeviceName) ? specs.DeviceName : null; ;
Locale = specs.Locale;
OSVersion = !string.IsNullOrWhiteSpace(specs.UAHints?.CalculatedOSVersion) ? specs.UAHints.CalculatedOSVersion : specs.CalculatedOSVersion;
Platform = specs.UAHints.CalculatedPlatform ?? specs.Platform;
Platform = specs.UAHints?.CalculatedPlatform ?? specs.Platform;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The IDE also displayed a warning here saying that UAHints could be null. One of the tests failed due to it being null too.

using Microsoft.Extensions.DependencyInjection;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Raygun4Net.Tests.Blazor.WebAssembly
namespace Raygun.NetCore.Tests.Blazor.WebAssembly
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a recommendation by the IDE, to match the namespace definition with the folder name.

@@ -1,4 +1,5 @@
{
"Raygun": {
"ApiKey": "APIKEY"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tests failed to initialize because the appsettings.json was missing this key and so the init method threw an exception.

@@ -36,7 +36,7 @@ internal record RequestDetails
/// The HTTP method used to request the URL (GET, POST, PUT, etc).
/// </summary>
[JsonInclude]
public HttpMethod HttpMethod { get; set; }
public string HttpMethod { get; set; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a bit strange, not sure if it was a typo or on purpose. The JSON parser failed trying to convert this. The rest of the code did not complain after the change.

This was referenced Jul 16, 2024
Copy link
Contributor

@TheRealAgentK TheRealAgentK left a comment

Choose a reason for hiding this comment

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

On a high level the changes make sense to me, but GH shows a bunch of build warnings toward the end of the files view.

@miquelbeltran
Copy link
Contributor Author

On a high level the changes make sense to me, but GH shows a bunch of build warnings toward the end of the files view.

The warnings are fixed on a different PR. #12

* ci: dotnet formatting

* simplify job

* test break formatting

* fix format

* dotnet format
@miquelbeltran miquelbeltran mentioned this pull request Jul 17, 2024
11 tasks
Copy link
Contributor

@TheRealAgentK TheRealAgentK left a comment

Choose a reason for hiding this comment

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

To me this PR looks overall good and doesn't raise any obvious concern to me (high level review, mind you)

@miquelbeltran miquelbeltran merged commit 9143caf into main Jul 17, 2024
2 checks passed
@miquelbeltran miquelbeltran deleted the 4-fix-tests branch July 17, 2024 05:22
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.

2 participants