From 23942b0f92182007c77153a721ea04a7e12c5d16 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 4 Jul 2024 16:14:02 +0100 Subject: [PATCH 01/15] add tests with base test class --- .../ModelCurveArrayToSpeckleConverterTests.cs | 72 ++++++++----------- .../Speckle.Converters.Revit2023.Tests.csproj | 3 +- .../ArcToSpeckleConverterTests.cs | 65 +++++++++++++++++ .../EllipseToSpeckleConverterTests.cs | 30 +++----- .../Speckle.Converters.Rhino7.Tests.csproj | 5 +- .../ToSpeckle/Raw/ArcToSpeckleConverter.cs | 7 +- .../ToSpeckle/Raw/BoxFactory.cs | 9 +++ Sdk/Speckle.Testing/MoqTest.cs | 18 +++++ Sdk/Speckle.Testing/Speckle.Testing.csproj | 10 +++ Sdk/Speckle.Testing/packages.lock.json | 67 +++++++++++++++++ 10 files changed, 220 insertions(+), 66 deletions(-) create mode 100644 Converters/Rhino/Speckle.Converters.Rhino7.Tests/ArcToSpeckleConverterTests.cs create mode 100644 Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxFactory.cs create mode 100644 Sdk/Speckle.Testing/MoqTest.cs create mode 100644 Sdk/Speckle.Testing/Speckle.Testing.csproj create mode 100644 Sdk/Speckle.Testing/packages.lock.json diff --git a/Converters/Revit/Speckle.Converters.Revit2023.Tests/ModelCurveArrayToSpeckleConverterTests.cs b/Converters/Revit/Speckle.Converters.Revit2023.Tests/ModelCurveArrayToSpeckleConverterTests.cs index 553c307d3..bed228864 100644 --- a/Converters/Revit/Speckle.Converters.Revit2023.Tests/ModelCurveArrayToSpeckleConverterTests.cs +++ b/Converters/Revit/Speckle.Converters.Revit2023.Tests/ModelCurveArrayToSpeckleConverterTests.cs @@ -1,46 +1,30 @@ -using System.Collections; -using FluentAssertions; -using Moq; +using FluentAssertions; using NUnit.Framework; using Objects; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared; using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Raw; using Speckle.Converters.RevitShared.Services; +using Speckle.Testing; namespace Speckle.Converters.Revit2023.Tests; -public class ModelCurveArrayToSpeckleConverterTests +public class ModelCurveArrayToSpeckleConverterTests : MoqTest { - private MockRepository _repository; - - private Mock _revitConversionContextStack; - private Mock _scalingServiceToSpeckle; - private Mock> _curveConverter; - - [SetUp] - public void Start() - { - _repository = new(MockBehavior.Strict); - _revitConversionContextStack = _repository.Create(); - _scalingServiceToSpeckle = _repository.Create(); - _curveConverter = _repository.Create>(); - } - - [TearDown] - public void Verify() => _repository.VerifyAll(); - [Test] public void Convert_Empty() { + var revitConversionContextStack = Create(); + var scalingServiceToSpeckle = Create(); + var curveConverter = Create>(); + var sut = new ModelCurveArrayToSpeckleConverter( - _revitConversionContextStack.Object, - _scalingServiceToSpeckle.Object, - _curveConverter.Object + revitConversionContextStack.Object, + scalingServiceToSpeckle.Object, + curveConverter.Object ); - var array = _repository.Create(); + var array = Create(); array.Setup(x => x.GetEnumerator()).Returns(Enumerable.Empty().GetEnumerator()); Assert.Throws(() => sut.Convert(array.Object)); } @@ -48,40 +32,44 @@ public void Convert_Empty() [Test] public void Convert() { - var endpoint1 = _repository.Create(); - var geometry1 = _repository.Create(); - var curve1 = _repository.Create(); + var revitConversionContextStack = Create(); + var scalingServiceToSpeckle = Create(); + var curveConverter = Create>(); + + var endpoint1 = Create(); + var geometry1 = Create(); + var curve1 = Create(); curve1.Setup(x => x.GeometryCurve).Returns(geometry1.Object); geometry1.Setup(x => x.Length).Returns(2); geometry1.Setup(x => x.GetEndPoint(0)).Returns(endpoint1.Object); - var endpoint2 = _repository.Create(); - var geometry2 = _repository.Create(); - var curve2 = _repository.Create(); + var endpoint2 = Create(); + var geometry2 = Create(); + var curve2 = Create(); curve2.Setup(x => x.GeometryCurve).Returns(geometry2.Object); geometry2.Setup(x => x.Length).Returns(3); geometry2.Setup(x => x.GetEndPoint(1)).Returns(endpoint2.Object); - var context = _repository.Create>(); - _revitConversionContextStack.Setup(x => x.Current).Returns(context.Object); + var context = Create>(); + revitConversionContextStack.Setup(x => x.Current).Returns(context.Object); var units = "units"; context.Setup(x => x.SpeckleUnits).Returns(units); var scaleLength = 2.2; - _scalingServiceToSpeckle.Setup(x => x.ScaleLength(2 + 3)).Returns(scaleLength); + scalingServiceToSpeckle.Setup(x => x.ScaleLength(2 + 3)).Returns(scaleLength); endpoint1.Setup(x => x.DistanceTo(endpoint2.Object)).Returns(4.4); - _curveConverter.Setup(x => x.Convert(geometry1.Object)).Returns(_repository.Create().Object); - _curveConverter.Setup(x => x.Convert(geometry2.Object)).Returns(_repository.Create().Object); + curveConverter.Setup(x => x.Convert(geometry1.Object)).Returns(Create().Object); + curveConverter.Setup(x => x.Convert(geometry2.Object)).Returns(Create().Object); var sut = new ModelCurveArrayToSpeckleConverter( - _revitConversionContextStack.Object, - _scalingServiceToSpeckle.Object, - _curveConverter.Object + revitConversionContextStack.Object, + scalingServiceToSpeckle.Object, + curveConverter.Object ); - var array = _repository.Create(); + var array = Create(); array .Setup(x => x.GetEnumerator()) diff --git a/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj b/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj index 606ffd308..54d5354a0 100644 --- a/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj +++ b/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -17,6 +17,7 @@ + diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/ArcToSpeckleConverterTests.cs b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/ArcToSpeckleConverterTests.cs new file mode 100644 index 000000000..6d79b7e0e --- /dev/null +++ b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/ArcToSpeckleConverterTests.cs @@ -0,0 +1,65 @@ +using FluentAssertions; +using Moq; +using NUnit.Framework; +using Rhino; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Converters.Rhino7.ToSpeckle.Raw; +using Speckle.Testing; + +namespace Speckle.Converters.Rhino7.Tests; + +public class ArcToSpeckleConverterTests : MoqTest +{ + [Test] + public void Convert_ShouldConvertArcCorrectly() + { + // Arrange + var radius = 1.1d; + var mockPointConverter = Create>(); + var mockPlaneConverter = Create>(); + var mockBoxConverter = Create>(); + var mockContextStack = Create>(); + var factory = Create(); + + var context = Create>(); + context.Setup(x => x.SpeckleUnits).Returns("units"); + mockContextStack.Setup(cs => cs.Current).Returns(context.Object); + + var targetArc = Create(); + var targetPlane = Create(); + var targetBox = Create(); + var point3d = Create(); + var boundbox = Create(); + + targetArc.Setup(x => x.Plane).Returns(targetPlane.Object); + targetArc.Setup(x => x.Radius).Returns(radius); + targetArc.Setup(x => x.StartAngle).Returns(radius); + targetArc.Setup(x => x.EndAngle).Returns(radius); + targetArc.Setup(x => x.Angle).Returns(radius); + targetArc.Setup(x => x.Length).Returns(radius); + targetArc.Setup(x => x.StartPoint).Returns(point3d.Object); + targetArc.Setup(x => x.MidPoint).Returns(point3d.Object); + targetArc.Setup(x => x.EndPoint).Returns(point3d.Object); + targetArc.Setup(x => x.BoundingBox()).Returns(boundbox.Object); + factory.Setup(x => x.Create(boundbox.Object)).Returns(targetBox.Object); + + mockPlaneConverter.Setup(pc => pc.Convert(targetPlane.Object)).Returns(new SOG.Plane()); + mockPointConverter.Setup(pc => pc.Convert(It.IsAny())).Returns(new SOG.Point()); + mockBoxConverter.Setup(bc => bc.Convert(targetBox.Object)).Returns(new SOG.Box()); + + var converter = new ArcToSpeckleConverter( + mockPointConverter.Object, + mockPlaneConverter.Object, + mockBoxConverter.Object, + mockContextStack.Object, + factory.Object + ); + + // Act + var result = converter.Convert(targetArc.Object); + + // Assert + result.Should().NotBeNull(); + } +} diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/EllipseToSpeckleConverterTests.cs b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/EllipseToSpeckleConverterTests.cs index b61be644f..e4019d32b 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/EllipseToSpeckleConverterTests.cs +++ b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/EllipseToSpeckleConverterTests.cs @@ -1,29 +1,21 @@ -using Moq; -using NUnit.Framework; +using NUnit.Framework; using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Converters.Rhino7.ToSpeckle.Raw; +using Speckle.Testing; namespace Speckle.Converters.Rhino7.Tests; -public class EllipseToSpeckleConverterTests +public class EllipseToSpeckleConverterTests : MoqTest { - private MockRepository _repository; - - private Mock> _conversionContextStack; - - private Mock> _planeConverter; - private Mock> _boxConverter; - - [SetUp] - public void Setup() + [Test] + public void Convert_Test() { - _repository = new(MockBehavior.Strict); - _conversionContextStack = _repository.Create>(); - _planeConverter = _repository.Create>(); - _boxConverter = _repository.Create>(); - } + var conversionContextStack = Create>(); + var planeConverter = Create>(); + var boxConverter = Create>(); - [TearDown] - public void Verify() => _repository.VerifyAll(); + var x = new EllipseToSpeckleConverter(planeConverter.Object, boxConverter.Object, conversionContextStack.Object); + } } diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/Speckle.Converters.Rhino7.Tests.csproj b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/Speckle.Converters.Rhino7.Tests.csproj index 7e6bc1996..c571040b6 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/Speckle.Converters.Rhino7.Tests.csproj +++ b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/Speckle.Converters.Rhino7.Tests.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -16,7 +16,8 @@ - + + diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcToSpeckleConverter.cs index 82c89c255..f9480ab04 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcToSpeckleConverter.cs @@ -10,18 +10,21 @@ public class ArcToSpeckleConverter : ITypedConverter private readonly ITypedConverter _planeConverter; private readonly ITypedConverter _boxConverter; private readonly IConversionContextStack _contextStack; + private readonly IBoxFactory _boxFactory; public ArcToSpeckleConverter( ITypedConverter pointConverter, ITypedConverter planeConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConversionContextStack contextStack, + IBoxFactory boxFactory ) { _pointConverter = pointConverter; _planeConverter = planeConverter; _boxConverter = boxConverter; _contextStack = contextStack; + _boxFactory = boxFactory; } /// @@ -47,6 +50,6 @@ public SOG.Arc Convert(RG.Arc target) => endPoint = _pointConverter.Convert(target.EndPoint), domain = new SOP.Interval(0, 1), length = target.Length, - bbox = _boxConverter.Convert(new RG.Box(target.BoundingBox())) + bbox = _boxConverter.Convert(_boxFactory.Create(target.BoundingBox())) }; } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxFactory.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxFactory.cs new file mode 100644 index 000000000..fd39fa2ba --- /dev/null +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxFactory.cs @@ -0,0 +1,9 @@ +using Speckle.InterfaceGenerator; + +namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; + +[GenerateAutoInterface] +public class BoxFactory : IBoxFactory +{ + public RG.Box Create(RG.BoundingBox bb) => new(bb); +} diff --git a/Sdk/Speckle.Testing/MoqTest.cs b/Sdk/Speckle.Testing/MoqTest.cs new file mode 100644 index 000000000..0e697e14c --- /dev/null +++ b/Sdk/Speckle.Testing/MoqTest.cs @@ -0,0 +1,18 @@ +using Moq; +using NUnit.Framework; + +namespace Speckle.Testing; + +public abstract class MoqTest +{ + [SetUp] + public void Setup() => Repository = new(MockBehavior.Strict); + + [TearDown] + public void Verify() => Repository.VerifyAll(); + + protected MockRepository Repository { get; private set; } = new(MockBehavior.Strict); + + protected Mock Create() + where T : class => Repository.Create(); +} diff --git a/Sdk/Speckle.Testing/Speckle.Testing.csproj b/Sdk/Speckle.Testing/Speckle.Testing.csproj new file mode 100644 index 000000000..a266dd26d --- /dev/null +++ b/Sdk/Speckle.Testing/Speckle.Testing.csproj @@ -0,0 +1,10 @@ + + + + net8.0 + + + + + + diff --git a/Sdk/Speckle.Testing/packages.lock.json b/Sdk/Speckle.Testing/packages.lock.json new file mode 100644 index 000000000..9dba1909b --- /dev/null +++ b/Sdk/Speckle.Testing/packages.lock.json @@ -0,0 +1,67 @@ +{ + "version": 2, + "dependencies": { + "net8.0": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, + "Moq": { + "type": "Direct", + "requested": "[4.20.70, )", + "resolved": "4.20.70", + "contentHash": "4rNnAwdpXJBuxqrOCzCyICXHSImOTRktCgCWXWykuF1qwoIsVvEnR7PjbMk/eLOxWvhmj5Kwt+kDV3RGUYcNwg==", + "dependencies": { + "Castle.Core": "5.1.1" + } + }, + "NUnit": { + "type": "Direct", + "requested": "[4.1.0, )", + "resolved": "4.1.0", + "contentHash": "MT/DpAhjtiytzhTgTqIhBuWx4y26PKfDepYUHUM+5uv4TsryHC2jwFo5e6NhWkApCm/G6kZ80dRjdJFuAxq3rg==" + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.14.1, )", + "resolved": "1.14.1", + "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" + }, + "Speckle.InterfaceGenerator": { + "type": "Direct", + "requested": "[0.9.5, )", + "resolved": "0.9.5", + "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" + }, + "Castle.Core": { + "type": "Transitive", + "resolved": "5.1.1", + "contentHash": "rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==", + "dependencies": { + "System.Diagnostics.EventLog": "6.0.0" + } + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, + "System.Diagnostics.EventLog": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==" + } + } + } +} \ No newline at end of file From b512a57aecfa041440c6376941df360d0626ba74 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 4 Jul 2024 16:14:42 +0100 Subject: [PATCH 02/15] update locks --- .../packages.lock.json | 20 +++++++++---------- .../packages.lock.json | 20 +++++++++---------- .../packages.lock.json | 20 +++++++++---------- .../packages.lock.json | 18 ++++++++--------- .../packages.lock.json | 8 ++++---- .../packages.lock.json | 2 +- .../packages.lock.json | 2 +- .../packages.lock.json | 2 +- .../packages.lock.json | 8 ++++---- .../packages.lock.json | 7 +++++++ .../packages.lock.json | 2 +- .../packages.lock.json | 8 ++++---- .../packages.lock.json | 7 +++++++ .../packages.lock.json | 2 +- .../packages.lock.json | 12 +++++------ .../Speckle.Connectors.DUI/packages.lock.json | 2 +- .../packages.lock.json | 2 +- Speckle.Connectors.sln | 7 +++++++ 18 files changed, 85 insertions(+), 64 deletions(-) diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json index b975016a9..54139e81e 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json @@ -381,8 +381,8 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Connectors.Utils": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Connectors.Utils": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } @@ -391,14 +391,14 @@ "type": "Project", "dependencies": { "Microsoft.Web.WebView2": "[1.0.1823.32, )", - "Speckle.Connectors.DUI": "[2.0.999-local, )" + "Speckle.Connectors.DUI": "[1.0.0, )" } }, "speckle.connectors.utils": { "type": "Project", "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )" } }, @@ -406,29 +406,29 @@ "type": "Project", "dependencies": { "Esri.ArcGISPro.Extensions30": "[3.2.0.49743, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Converters.Common": "[1.0.0, )" } }, "speckle.converters.arcgis3.dependencyinjection": { "type": "Project", "dependencies": { "Autofac": "[5.2.0, )", - "Speckle.Converters.ArcGIS3": "[2.0.999-local, )", - "Speckle.Converters.Common.DependencyInjection": "[2.0.999-local, )" + "Speckle.Converters.ArcGIS3": "[1.0.0, )", + "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Converters.Common": "[1.0.0, )" } }, "Autofac": { diff --git a/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json b/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json index 0fff9ad56..da2f82f48 100644 --- a/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json +++ b/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json @@ -434,8 +434,8 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Connectors.Utils": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Connectors.Utils": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } @@ -444,14 +444,14 @@ "type": "Project", "dependencies": { "Microsoft.Web.WebView2": "[1.0.1823.32, )", - "Speckle.Connectors.DUI": "[2.0.999-local, )" + "Speckle.Connectors.DUI": "[1.0.0, )" } }, "speckle.connectors.utils": { "type": "Project", "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )" } }, @@ -459,29 +459,29 @@ "type": "Project", "dependencies": { "Speckle.AutoCAD.API": "[2023.0.0, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Converters.Common": "[1.0.0, )" } }, "speckle.converters.autocad2023.dependencyinjection": { "type": "Project", "dependencies": { "Autofac": "[5.2.0, )", - "Speckle.Converters.Autocad2023": "[2.0.999-local, )", - "Speckle.Converters.Common.DependencyInjection": "[2.0.999-local, )" + "Speckle.Converters.Autocad2023": "[1.0.0, )", + "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Converters.Common": "[1.0.0, )" } }, "Autofac": { diff --git a/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json b/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json index 503e92ef5..4a40eed3d 100644 --- a/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json +++ b/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json @@ -452,8 +452,8 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Connectors.Utils": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Connectors.Utils": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } @@ -462,37 +462,37 @@ "type": "Project", "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Converters.Common": "[1.0.0, )" } }, "speckle.converters.revit2023": { "type": "Project", "dependencies": { - "Speckle.Converters.Common": "[2.0.999-local, )", + "Speckle.Converters.Common": "[1.0.0, )", "Speckle.Revit.API": "[2023.0.0, )" } }, "speckle.converters.revit2023.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Converters.Common": "[2.0.999-local, )", - "Speckle.Converters.Common.DependencyInjection": "[2.0.999-local, )", - "Speckle.Converters.Revit2023": "[2.0.999-local, )" + "Speckle.Converters.Common": "[1.0.0, )", + "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )", + "Speckle.Converters.Revit2023": "[1.0.0, )" } }, "Microsoft.Extensions.Logging.Abstractions": { diff --git a/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json b/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json index b85fe9941..b3244d587 100644 --- a/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json +++ b/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json @@ -442,8 +442,8 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Connectors.Utils": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Connectors.Utils": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } @@ -452,42 +452,42 @@ "type": "Project", "dependencies": { "Microsoft.Web.WebView2": "[1.0.1823.32, )", - "Speckle.Connectors.DUI": "[2.0.999-local, )" + "Speckle.Connectors.DUI": "[1.0.0, )" } }, "speckle.connectors.utils": { "type": "Project", "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Converters.Common": "[1.0.0, )" } }, "speckle.converters.rhino7": { "type": "Project", "dependencies": { "RhinoCommon": "[7.13.21348.13001, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Converters.Common": "[1.0.0, )" } }, "speckle.converters.rhino7.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Converters.Rhino7": "[2.0.999-local, )" + "Speckle.Converters.Rhino7": "[1.0.0, )" } }, "Microsoft.Extensions.Logging.Abstractions": { diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json b/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json index 9f83e4c13..bf3411b5a 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json @@ -363,21 +363,21 @@ "type": "Project", "dependencies": { "Esri.ArcGISPro.Extensions30": "[3.2.0.49743, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Converters.Common": "[1.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Converters.Common": "[1.0.0, )" } }, "Esri.ArcGISPro.Extensions30": { diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json index b77f27c0b..e804466aa 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json @@ -362,7 +362,7 @@ "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, diff --git a/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json index 3c281f9dc..e6d9cf745 100644 --- a/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json +++ b/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json @@ -363,7 +363,7 @@ "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, diff --git a/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json index 0a1d936ce..0b4a4a188 100644 --- a/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json +++ b/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json @@ -363,7 +363,7 @@ "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, diff --git a/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json index 254754bd4..0b9e986df 100644 --- a/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json @@ -357,21 +357,21 @@ "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Converters.Common": "[1.0.0, )" } }, "speckle.converters.revit2023": { "type": "Project", "dependencies": { - "Speckle.Converters.Common": "[2.0.999-local, )", + "Speckle.Converters.Common": "[1.0.0, )", "Speckle.Revit.API": "[2023.0.0, )" } }, diff --git a/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json index aad14a791..f36f1cc95 100644 --- a/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json @@ -486,6 +486,13 @@ "Speckle.Objects": "[3.0.1-alpha.14, )" } }, + "speckle.testing": { + "type": "Project", + "dependencies": { + "Moq": "[4.20.70, )", + "NUnit": "[4.1.0, )" + } + }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", "requested": "[7.0.0, )", diff --git a/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json index 742efddba..bb8ff70be 100644 --- a/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json @@ -363,7 +363,7 @@ "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json b/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json index 46797a010..027e8ee2a 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json +++ b/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json @@ -357,22 +357,22 @@ "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Converters.Common": "[1.0.0, )" } }, "speckle.converters.rhino7": { "type": "Project", "dependencies": { "RhinoCommon": "[7.13.21348.13001, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "Speckle.Converters.Common": "[1.0.0, )" } }, "Microsoft.Extensions.Logging.Abstractions": { diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/packages.lock.json b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/packages.lock.json index 767275e9b..8e1822fe5 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/packages.lock.json +++ b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/packages.lock.json @@ -486,6 +486,13 @@ "Speckle.Objects": "[3.0.1-alpha.14, )" } }, + "speckle.testing": { + "type": "Project", + "dependencies": { + "Moq": "[4.20.70, )", + "NUnit": "[4.1.0, )" + } + }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", "requested": "[7.0.0, )", diff --git a/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json b/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json index 98fcfe015..e1c8c23cd 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json +++ b/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json @@ -363,7 +363,7 @@ "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, diff --git a/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json b/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json index ff084cdbe..8fb50ba50 100644 --- a/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json +++ b/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json @@ -424,8 +424,8 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Connectors.Utils": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Connectors.Utils": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } @@ -434,7 +434,7 @@ "type": "Project", "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )" } }, @@ -863,8 +863,8 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Connectors.Utils": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", + "Speckle.Connectors.Utils": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } @@ -873,7 +873,7 @@ "type": "Project", "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )" } }, diff --git a/DUI3/Speckle.Connectors.DUI/packages.lock.json b/DUI3/Speckle.Connectors.DUI/packages.lock.json index 9f44602e7..84b35111a 100644 --- a/DUI3/Speckle.Connectors.DUI/packages.lock.json +++ b/DUI3/Speckle.Connectors.DUI/packages.lock.json @@ -537,7 +537,7 @@ "type": "Project", "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Core": "[3.0.1-alpha.14, )" } }, diff --git a/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json b/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json index cb39bea47..2a44b6a50 100644 --- a/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json +++ b/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json @@ -463,7 +463,7 @@ "speckle.converters.common": { "type": "Project", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Autofac": "[1.0.0, )", "Speckle.Objects": "[3.0.1-alpha.14, )" } }, diff --git a/Speckle.Connectors.sln b/Speckle.Connectors.sln index e521763f8..3a3df0c5e 100644 --- a/Speckle.Connectors.sln +++ b/Speckle.Connectors.sln @@ -98,6 +98,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Rhino7.T EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Revit2023.Tests", "Converters\Revit\Speckle.Converters.Revit2023.Tests\Speckle.Converters.Revit2023.Tests.csproj", "{68CF9BDF-94AC-4D2D-A7BD-D1C064F97051}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Testing", "Sdk\Speckle.Testing\Speckle.Testing.csproj", "{A3869243-B462-4986-914B-94E407D8D20F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -208,6 +210,10 @@ Global {68CF9BDF-94AC-4D2D-A7BD-D1C064F97051}.Debug|Any CPU.Build.0 = Debug|Any CPU {68CF9BDF-94AC-4D2D-A7BD-D1C064F97051}.Release|Any CPU.ActiveCfg = Release|Any CPU {68CF9BDF-94AC-4D2D-A7BD-D1C064F97051}.Release|Any CPU.Build.0 = Release|Any CPU + {A3869243-B462-4986-914B-94E407D8D20F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A3869243-B462-4986-914B-94E407D8D20F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A3869243-B462-4986-914B-94E407D8D20F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A3869243-B462-4986-914B-94E407D8D20F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {C9D4CA21-182B-4ED2-81BB-280A6FD713F6} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} @@ -246,5 +252,6 @@ Global {E1C43415-3200-45F4-8BF9-A4DD7D7F2ED9} = {9584AEE5-CD59-46E6-93E6-2DC2B5285B75} {AC2DB416-F05C-4296-9040-56D6AD4FCD27} = {9584AEE5-CD59-46E6-93E6-2DC2B5285B75} {68CF9BDF-94AC-4D2D-A7BD-D1C064F97051} = {D92751C8-1039-4005-90B2-913E55E0B8BD} + {A3869243-B462-4986-914B-94E407D8D20F} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} EndGlobalSection EndGlobal From e6c19eb9652da32faed14cf6e044cfc42a26b70f Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 4 Jul 2024 16:36:33 +0100 Subject: [PATCH 03/15] pin coverage to 4.4.0 --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a7c2110d..dcc6a88c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,11 +39,10 @@ jobs: run: ./build.ps1 - name: Upload coverage reports to Codecov with GitHub Action - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v4.4.0 with: + token: ${{ secrets.CODECOV_TOKEN }} files: ./**/*.Tests/coverage.xml - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: ⬆️ Upload artifacts uses: actions/upload-artifact@v4 From 4269957b08a5b543c1a7db75188ed50be23a8410 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 4 Jul 2024 16:43:38 +0100 Subject: [PATCH 04/15] this is a subjob with uses, pass the secrets --- .github/workflows/ci.yml | 2 +- .github/workflows/main.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcc6a88c3..09900f8ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: run: ./build.ps1 - name: Upload coverage reports to Codecov with GitHub Action - uses: codecov/codecov-action@v4.4.0 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./**/*.Tests/coverage.xml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b57d1957f..3d2012b54 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,8 @@ on: jobs: build: uses: ./.github/workflows/ci.yml + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # deploy-installers: # runs-on: ubuntu-latest From b22dcf7cd4db5ce61c6f002f6b7ab74ffd2d1f9f Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 4 Jul 2024 16:46:15 +0100 Subject: [PATCH 05/15] fix secret passing --- .github/workflows/ci.yml | 5 ++++- .github/workflows/main.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09900f8ea..b1950e01b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: - main - dev workflow_call: + secrets: + codecov_token: + required: true outputs: version: value: ${{ jobs.build.outputs.version }} @@ -41,7 +44,7 @@ jobs: - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v4 with: - token: ${{ secrets.CODECOV_TOKEN }} + token: ${{ secrets.codecov_token }} files: ./**/*.Tests/coverage.xml - name: ⬆️ Upload artifacts diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3d2012b54..c781e59f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: build: uses: ./.github/workflows/ci.yml secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + codecov_token: ${{ secrets.CODECOV_TOKEN }} # deploy-installers: # runs-on: ubuntu-latest From 86dc4bf4380d9609d0b384715aed11accaf3d0bc Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 4 Jul 2024 16:56:38 +0100 Subject: [PATCH 06/15] try quotes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1950e01b..dbad4a6d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: uses: codecov/codecov-action@v4 with: token: ${{ secrets.codecov_token }} - files: ./**/*.Tests/coverage.xml + files: "**/*.Tests/coverage.xml" - name: ⬆️ Upload artifacts uses: actions/upload-artifact@v4 From e3871d2d4f81c4a5ece7037252d30fb45075d888 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 4 Jul 2024 17:06:45 +0100 Subject: [PATCH 07/15] try a different glob --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbad4a6d2..caa20b7b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: uses: codecov/codecov-action@v4 with: token: ${{ secrets.codecov_token }} - files: "**/*.Tests/coverage.xml" + files: Converters/**/*.Tests/coverage.xml - name: ⬆️ Upload artifacts uses: actions/upload-artifact@v4 From 3ead1b698d223d03e69d4f5ce9fb68c0b608d077 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 5 Jul 2024 08:26:59 +0100 Subject: [PATCH 08/15] Try simplier glob --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caa20b7b5..1be202674 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: uses: codecov/codecov-action@v4 with: token: ${{ secrets.codecov_token }} - files: Converters/**/*.Tests/coverage.xml + files: Converters/**/coverage.xml - name: ⬆️ Upload artifacts uses: actions/upload-artifact@v4 From 43757014c11f28eda52306526f916842787a3282 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 5 Jul 2024 08:39:40 +0100 Subject: [PATCH 09/15] try something else --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1be202674..620093243 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,8 +44,8 @@ jobs: - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v4 with: + file: Converters/**/coverage.xml token: ${{ secrets.codecov_token }} - files: Converters/**/coverage.xml - name: ⬆️ Upload artifacts uses: actions/upload-artifact@v4 From 5fcf52bcbf9efbba6c1c42153330e508c9b46a66 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 5 Jul 2024 08:49:42 +0100 Subject: [PATCH 10/15] try ubuntu for uploads --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++------- Build/Program.cs | 13 ++++++++++++- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 620093243..0b2d469e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,12 +40,6 @@ jobs: - name: ⚒️ Run build run: ./build.ps1 - - - name: Upload coverage reports to Codecov with GitHub Action - uses: codecov/codecov-action@v4 - with: - file: Converters/**/coverage.xml - token: ${{ secrets.codecov_token }} - name: ⬆️ Upload artifacts uses: actions/upload-artifact@v4 @@ -56,4 +50,29 @@ jobs: - id: set-version name: Set version to output - run: echo "version=${{ env.GitVersion_FullSemVer }}" >> "$GITHUB_OUTPUT" + run: echo "version=${{ env.GitVersion_FullSemVer }}" >> "$GITHUB_OUTPUT" + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.2xx # Align with global.json (including roll forward rules) + + - name: Cache Nuget + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + + - name: ⚒️ Run build + run: ./build.sh -- test-only + + - name: Upload coverage reports to Codecov with GitHub Action + uses: codecov/codecov-action@v4 + with: + file: Converters/**/coverage.xml + token: ${{ secrets.codecov_token }} diff --git a/Build/Program.cs b/Build/Program.cs index 8f06f2c8a..935eb0208 100644 --- a/Build/Program.cs +++ b/Build/Program.cs @@ -8,6 +8,7 @@ const string RESTORE = "restore"; const string BUILD = "build"; const string TEST = "test"; +const string TEST_ONLY = "test-only"; const string FORMAT = "format"; const string ZIP = "zip"; const string VERSION = "version"; @@ -115,7 +116,17 @@ void RemoveDirectory(string d) Glob.Files(".", "**/*.Tests.csproj"), file => { - Run("dotnet", $"test {file} -c Release --no-build --no-restore --verbosity=normal /p:AltCover=true"); + Run("dotnet", $"test {file} -c Release --no-build --no-restore --verbosity=normal"); + } +); + +Target( + TEST_ONLY, + DependsOn(RESTORE), + Glob.Files(".", "**/*.Tests.csproj"), + file => + { + Run("dotnet", $"test {file} -c Release --no-restore --verbosity=normal /p:AltCover=true"); } ); From b26231698a7dadf8c52a782414f7b27686e68fd4 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 5 Jul 2024 08:51:47 +0100 Subject: [PATCH 11/15] update build.sh --- build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 From a668956a78c16d15afd7f9e97310054661dbfc41 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 5 Jul 2024 08:55:05 +0100 Subject: [PATCH 12/15] fix target --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b2d469e1..4a2364e8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} - name: ⚒️ Run build - run: ./build.sh -- test-only + run: ./build.sh test-only - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v4 From dd91d99685fbe20daed2ab7b3ace905bd2c51cfb Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 5 Jul 2024 08:58:20 +0100 Subject: [PATCH 13/15] update test only target --- Build/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Build/Program.cs b/Build/Program.cs index 935eb0208..416023dce 100644 --- a/Build/Program.cs +++ b/Build/Program.cs @@ -122,10 +122,11 @@ void RemoveDirectory(string d) Target( TEST_ONLY, - DependsOn(RESTORE), + DependsOn(FORMAT), Glob.Files(".", "**/*.Tests.csproj"), file => { + Run("dotnet", $"restore {file} --locked-mode"); Run("dotnet", $"test {file} -c Release --no-restore --verbosity=normal /p:AltCover=true"); } ); From 989a805f8473d64276b1561b015d93e120969d92 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 5 Jul 2024 09:31:20 +0100 Subject: [PATCH 14/15] Try ExcludeFromCodeCoverage --- .../ToSpeckle/Raw/BoxFactory.cs | 4 +++- Sdk/Speckle.Testing/MoqTest.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxFactory.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxFactory.cs index fd39fa2ba..cb78b9e05 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxFactory.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxFactory.cs @@ -1,8 +1,10 @@ -using Speckle.InterfaceGenerator; +using System.Diagnostics.CodeAnalysis; +using Speckle.InterfaceGenerator; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; [GenerateAutoInterface] +[ExcludeFromCodeCoverage] public class BoxFactory : IBoxFactory { public RG.Box Create(RG.BoundingBox bb) => new(bb); diff --git a/Sdk/Speckle.Testing/MoqTest.cs b/Sdk/Speckle.Testing/MoqTest.cs index 0e697e14c..c9862d620 100644 --- a/Sdk/Speckle.Testing/MoqTest.cs +++ b/Sdk/Speckle.Testing/MoqTest.cs @@ -1,8 +1,10 @@ -using Moq; +using System.Diagnostics.CodeAnalysis; +using Moq; using NUnit.Framework; namespace Speckle.Testing; +[ExcludeFromCodeCoverage] public abstract class MoqTest { [SetUp] From f7e1dab9e250da9262fa4cf107bbd85e2a1109f1 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 5 Jul 2024 09:44:44 +0100 Subject: [PATCH 15/15] better usage of codecov --- Build/Program.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Build/Program.cs b/Build/Program.cs index 416023dce..c0cedee85 100644 --- a/Build/Program.cs +++ b/Build/Program.cs @@ -127,7 +127,10 @@ void RemoveDirectory(string d) file => { Run("dotnet", $"restore {file} --locked-mode"); - Run("dotnet", $"test {file} -c Release --no-restore --verbosity=normal /p:AltCover=true"); + Run( + "dotnet", + $"test {file} -c Release --no-restore --verbosity=normal /p:AltCover=true /p:AltCoverLocalSource=true /p:AltCoverAttributeFilter=ExcludeFromCodeCoverage" + ); } );