Fix/cli#320
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves reliability of the .NET CLI test suite by replacing lock (Configuration.objLock) with a disposable, SemaphoreSlim-based synchronization API that supports both sync and async test flows, and enhances the CD workflow to package and publish both the framework and CLI NuGet artifacts.
Changes:
- Replaced the shared test synchronization object with
Configuration.Lock()/Configuration.LockAsync()disposable acquisition helpers backed bySemaphoreSlim. - Updated CLI test suite call sites to use the new locking pattern (including converting one test to async/await).
- Updated the GitHub Actions CD workflow to set versions earlier and to pack + stage both framework and CLI NuGet packages before uploading artifacts.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| IO.Astrodynamics.Net/IO.Astrodynamics.CLI.Tests/Configuration.cs | Introduces SemaphoreSlim-based disposable locking API for tests (sync + async). |
| IO.Astrodynamics.Net/IO.Astrodynamics.CLI.Tests/TimeTests.cs | Migrates test synchronization from lock to using (Configuration.Lock()). |
| IO.Astrodynamics.Net/IO.Astrodynamics.CLI.Tests/PropagateTests.cs | Converts test to async and uses LockAsync() + await for propagation. |
| IO.Astrodynamics.Net/IO.Astrodynamics.CLI.Tests/OrientationTests.cs | Migrates test synchronization to Configuration.Lock(). |
| IO.Astrodynamics.Net/IO.Astrodynamics.CLI.Tests/OrbitalParametersTests.cs | Migrates test synchronization to Configuration.Lock(). |
| IO.Astrodynamics.Net/IO.Astrodynamics.CLI.Tests/GeometryFinderTests.cs | Migrates test synchronization to Configuration.Lock(). |
| IO.Astrodynamics.Net/IO.Astrodynamics.CLI.Tests/FrameTests.cs | Migrates test synchronization to Configuration.Lock(). |
| IO.Astrodynamics.Net/IO.Astrodynamics.CLI.Tests/EphemerisTests.cs | Migrates test synchronization to Configuration.Lock(). |
| IO.Astrodynamics.Net/IO.Astrodynamics.CLI.Tests/BodyInformationTests.cs | Migrates test synchronization to Configuration.Lock(). |
| .github/workflows/cd.yml | Sets csproj version earlier; packs CLI as well; stages and uploads all produced .nupkg artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the test synchronization mechanism in the CLI test suite and improves the packaging process in the CI/CD workflow. The most important changes are the introduction of a safer, disposable-based locking mechanism for test synchronization, updates to all test files to use this mechanism, and enhancements to the GitHub Actions workflow for packaging and publishing NuGet packages.
Test synchronization improvements
objLockobject inConfiguration.cswith a staticSemaphoreSlim-based locking mechanism, providing both synchronous (Lock()) and asynchronous (LockAsync()) disposable lock acquisition methods for safer and more flexible test synchronization.BodyInformationTests.cs,EphemerisTests.cs,FrameTests.cs,GeometryFinderTests.cs,OrbitalParametersTests.cs,OrientationTests.cs,PropagateTests.cs,TimeTests.cs) to use the newusing (Configuration.Lock())orusing (await Configuration.LockAsync())pattern instead oflock (Configuration.objLock). This ensures proper lock release and supports async tests. [1] [2] [3] [4] [5] [6] [7] [8] etc.)CI/CD and packaging workflow enhancements
.csprojfiles earlier in the workflow to ensure the correct version is set before restoring dependencies.dotnet pack IO.Astrodynamics.CLI/IO.Astrodynamics.CLI.csproj) and a staging step that collects all NuGet packages into anupkg-stagingdirectory.These changes improve test reliability, make the test suite safer for parallel execution, and streamline the packaging and publishing process in CI/CD.