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

make Feature.properties optional #167

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

janusw
Copy link
Member

@janusw janusw commented Jul 3, 2023

@janusw
Copy link
Member Author

janusw commented Dec 29, 2023

@matt-lethargic @xfischer ping!

@xfischer
Copy link
Member

xfischer commented Jan 4, 2024

@janusw ping acknowledged. Can you add tests to this PR to make sure a Feature with properties and without properties is properly handled ?

@janusw
Copy link
Member Author

janusw commented Jan 4, 2024

@janusw ping acknowledged.

Thanks for the reply 😆

Can you add tests to this PR to make sure a Feature with properties and without properties is properly handled ?

Yeah, good point. I see that there is a GeoJSON.Net.Tests project with some NUnit integration. However I haven't really managed to execute it. If I try to run the tests in VS4Mac (v17.6.7), I get:

NUnit Adapter 3.8.0.0: Test execution started
Running all tests in ∼/GeoJSON.Net/src/GeoJSON.Net.Tests/bin/Debug/net45/GeoJSON.Net.Tests.dll
Dependent Assembly ∼/GeoJSON.Net/src/GeoJSON.Net.Tests/bin/Debug/net45/GeoJSON.Net.Tests.dll.mdb
of ∼/GeoJSON.Net/src/GeoJSON.Net.Tests/bin/Debug/net45/GeoJSON.Net.Tests.dll not found.
Can be ignored if not a NUnit project.
NUnit Adapter 3.8.0.0: Test execution complete
No test is available in ∼/GeoJSON.Net/src/GeoJSON.Net.Tests/bin/Debug/net45/GeoJSON.Net.Tests.dll.
Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

I also tried on the command line (on MacOS), but this gives me:

% dotnet test src/GeoJSON.Net.Tests                                      
  Determining projects to restore...
  All projects are up-to-date for restore.
CSC : error CS7027: Error signing output with public key from file 'key.snk' -- File not found. [∼/GeoJSON.Net/src/GeoJSON.Net/GeoJSON.Net.csproj::TargetFramework=net45]
CSC : error CS7027: Error signing output with public key from file 'key.snk' -- File not found. [∼/GeoJSON.Net/src/GeoJSON.Net/GeoJSON.Net.csproj::TargetFramework=netstandard2.1]

Any advice? What am I doing wrong? How do you run the tests, @xfischer?

@xfischer
Copy link
Member

xfischer commented Jan 4, 2024

Mmmh, I don't have a mac hanging around, so I cannot reproduce. I'll test on Windows

@janusw
Copy link
Member Author

janusw commented Jan 4, 2024

Also it would be nice to have some CI to do automatic builds and tests for every PR. I see that you have some Azure-based CI on master, but I cannot access this, and it doesn't seem to run on the PRs.

Would you accept a GitHub-Actions CI setup, if I'd contribute it? Or do you prefer to stick to Azure? (One can also have both in parallel.)

@xfischer
Copy link
Member

xfischer commented Jan 4, 2024

Also it would be nice to have some CI to do automatic builds and tests for every PR. I see that you have some Azure-based CI on master, but I cannot access this, and it doesn't seem to run on the PRs.

Would you accept a GitHub-Actions CI setup, if I'd contribute it? Or do you prefer to stick to Azure? (One can also have both in parallel.)

Yes, that would be great ! @matt-lethargic is it OK for you ?

@janusw
Copy link
Member Author

janusw commented Jan 4, 2024

Actually it seems there is some draft GHA setup already:

https://github.com/GeoJSON-Net/GeoJSON.Net/blob/master/.github/workflows/main.yml

However, it would currently only run on a hypothetic 'v2' branch (which does not exist). I can take that as a starting point and create a working setup from there ...

@janusw
Copy link
Member Author

janusw commented Jan 4, 2024

I also tried on the command line (on MacOS), but this gives me:

% dotnet test src/GeoJSON.Net.Tests                                      
  Determining projects to restore...
  All projects are up-to-date for restore.
CSC : error CS7027: Error signing output with public key from file 'key.snk' -- File not found. [∼/GeoJSON.Net/src/GeoJSON.Net/GeoJSON.Net.csproj::TargetFramework=net45]
CSC : error CS7027: Error signing output with public key from file 'key.snk' -- File not found. [∼/GeoJSON.Net/src/GeoJSON.Net/GeoJSON.Net.csproj::TargetFramework=netstandard2.1]

Actually testing the full sln seems to work well! 🥳

% dotnet test src/GeoJSON.Net.sln
[...]
Test run for ∼/GeoJSON.Net/src/GeoJSON.Net.Tests/bin/Debug/netcoreapp3.1/GeoJSON.Net.Tests.dll (.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 17.8.0 (arm64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
  Skipped FeatureCollection_Test_IndexOf [42 ms]

Passed!  - Failed:     0, Passed:   120, Skipped:     0, Total:   120, Duration: 1 s - GeoJSON.Net.Tests.dll (netcoreapp3.1)

* up to now it was required, but could be null
@janusw
Copy link
Member Author

janusw commented Feb 14, 2024

Can you add tests to this PR to make sure a Feature with properties and without properties is properly handled ?

By now I added a small test case that verifies that a feature without any properties is deserialized alright. Is the PR ok with this addition?

@janusw
Copy link
Member Author

janusw commented Feb 25, 2024

Can you add tests to this PR to make sure a Feature with properties and without properties is properly handled ?

By now I added a small test case that verifies that a feature without any properties is deserialized alright.

... and GitHub Actions verified that it works well and all tests succeed.

Is the PR ok with this addition?

@matt-lethargic @xfischer Ping!

@matt-lethargic
Copy link
Member

More than happy to move to GH Actions, the setup we had pre-dates them by a lot.
We have building, but really we should have a workflow that gets kicked off whenever we create a release in GH that pushes out to Nuget

@janusw
Copy link
Member Author

janusw commented Feb 25, 2024

More than happy to move to GH Actions, the setup we had pre-dates them by a lot. We have building, but really we should have a workflow that gets kicked off whenever we create a release in GH that pushes out to Nuget

IMHO the most important part would be to build a nupkg in every GHA build, and make it available as an artifact. That should be pretty simple, and I can take care of it.

Once that is done, pushing such a pkg to nuget.org (for a release tag) is a relatively small step that is easy to do manually But, yes, one can also automate that.

In any case, all of this is orthogonal to this PR, which contains a simple one-line fix (with a simple test case).

@janusw
Copy link
Member Author

janusw commented Feb 27, 2024

More than happy to move to GH Actions, the setup we had pre-dates them by a lot. We have building, but really we should have a workflow that gets kicked off whenever we create a release in GH that pushes out to Nuget

IMHO the most important part would be to build a nupkg in every GHA build, and make it available as an artifact. That should be pretty simple, and I can take care of it.

See PR #175.

@xfischer xfischer merged commit 36be431 into GeoJSON-Net:master Feb 28, 2024
1 check passed
@janusw janusw deleted the feature_properties_optional branch February 28, 2024 17:31
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