Skip to content

Commit

Permalink
Testing using github secret
Browse files Browse the repository at this point in the history
  • Loading branch information
srivastavarahull committed Aug 10, 2023
1 parent 4d2fcb1 commit f29c4a4
Show file tree
Hide file tree
Showing 19 changed files with 132 additions and 102 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/testMD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ jobs:
run: |
dotnet restore
dotnet test

env:
Client_Id: ${{ secrets.CLIENT_ID }}
Client_Secret: ${{ secrets.CLIENT_SECRET }}

1 change: 1 addition & 0 deletions BetaTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<PackageReference Include="MSTest.TestFramework" Version="2.2.8"/>
<PackageReference Include="coverlet.collector" Version="3.1.2"/>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0"/>
<PackageReference Include="Autodesk.Forge" Version="1.9.7" />
</ItemGroup>
</Project>
107 changes: 14 additions & 93 deletions TestOSS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,118 +4,39 @@ namespace Autodesk.OSS.Test;
using Autodesk.SDKManager;
using Autodesk.Oss;
using Autodesk.Oss.Model;
using Autodesk.Forge;

[TestClass]
public class TestModelDerivativeAPi
{
private static OssApi ossApi= null!;
private string token = "eyJhbGciOiJSUzI1NiIsImtpZCI6IjY0RE9XMnJoOE9tbjNpdk1NU0xlNGQ2VHEwUSIsInBpLmF0bSI6Ijd6M2gifQ.eyJzY29wZSI6WyJkYXRhOnJlYWQiLCJkYXRhOndyaXRlIiwiZGF0YTpjcmVhdGUiLCJkYXRhOnNlYXJjaCIsImJ1Y2tldDpjcmVhdGUiLCJidWNrZXQ6cmVhZCIsImJ1Y2tldDp1cGRhdGUiLCJidWNrZXQ6ZGVsZXRlIiwiYWNjb3VudDpyZWFkIiwiYWNjb3VudDp3cml0ZSIsImNvZGU6YWxsIl0sImNsaWVudF9pZCI6Ikp1enlEQWlmMjVjSUFYZlpuMHJBd2ltSUFaVEdMeEFRIiwiYXVkIjoiaHR0cHM6Ly9hdXRvZGVzay5jb20vYXVkL2Fqd3RleHA2MCIsImp0aSI6ImZVajdtSGxVRWFmYUtaZmhVbURPT1JCMkZRS2tSNUMyMlptT3Zac2ppYzQ1WVBWY1BUUjJNeENKRE85N1pSbWEiLCJleHAiOjE2OTE1ODMyODF9.a8zxqD1L0eDydfqCuxL-gjT9YPfXajutgkQldSUJQnNBcDMAk_r2sluuakDh3sMYQfOakI3JdJ5zbsK1rqdrHE9Xm0VIY3Ajb4qmni5RQQFu5p5opbznFM_kQk3mguuXUFa4m7BEfoQZmenrIgrJEDESVBuQ3XW9CXRs2ZjLYquKGRQcLlVkTbRljWQnTIhx_dT05ylOJpDcpN2bi1zXgpuIw97O500DuCcVIRFv_3h_tc6LUOU6dDCwjrXpD-j8wW3WPFaEizG2ZGdnVuoLQcM9pjeM3dti_5nUNto3gbTjGT6ihRpNFE2AZntHfFIIs_0Gg5JHiCAPyMmBykgeQQ";
private static string token;

Check warning on line 13 in TestOSS.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'token' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
// static string _clientId = "JuzyDAif25cIAXfZn0rAwimIAZTGLxAQ";
// static string _clientSecret ="WR3JjH9t7wabj6LB";
static string _clientId = Environment.GetEnvironmentVariable("Client_ID")!;
static string _clientSecret = Environment.GetEnvironmentVariable("CLIENT_SECRET")!;
// private string token = "eyJhbGciOiJSUzI1NiIsImtpZCI6IjY0RE9XMnJoOE9tbjNpdk1NU0xlNGQ2VHEwUSIsInBpLmF0bSI6Ijd6M2gifQ.eyJzY29wZSI6WyJkYXRhOnJlYWQiLCJkYXRhOndyaXRlIiwiZGF0YTpjcmVhdGUiLCJkYXRhOnNlYXJjaCIsImJ1Y2tldDpjcmVhdGUiLCJidWNrZXQ6cmVhZCIsImJ1Y2tldDp1cGRhdGUiLCJidWNrZXQ6ZGVsZXRlIiwiYWNjb3VudDpyZWFkIiwiYWNjb3VudDp3cml0ZSIsImNvZGU6YWxsIl0sImNsaWVudF9pZCI6Ikp1enlEQWlmMjVjSUFYZlpuMHJBd2ltSUFaVEdMeEFRIiwiYXVkIjoiaHR0cHM6Ly9hdXRvZGVzay5jb20vYXVkL2Fqd3RleHA2MCIsImp0aSI6ImZVajdtSGxVRWFmYUtaZmhVbURPT1JCMkZRS2tSNUMyMlptT3Zac2ppYzQ1WVBWY1BUUjJNeENKRE85N1pSbWEiLCJleHAiOjE2OTE1ODMyODF9.a8zxqD1L0eDydfqCuxL-gjT9YPfXajutgkQldSUJQnNBcDMAk_r2sluuakDh3sMYQfOakI3JdJ5zbsK1rqdrHE9Xm0VIY3Ajb4qmni5RQQFu5p5opbznFM_kQk3mguuXUFa4m7BEfoQZmenrIgrJEDESVBuQ3XW9CXRs2ZjLYquKGRQcLlVkTbRljWQnTIhx_dT05ylOJpDcpN2bi1zXgpuIw97O500DuCcVIRFv_3h_tc6LUOU6dDCwjrXpD-j8wW3WPFaEizG2ZGdnVuoLQcM9pjeM3dti_5nUNto3gbTjGT6ihRpNFE2AZntHfFIIs_0Gg5JHiCAPyMmBykgeQQ";
private string bucketKey = "juzydaif25ciaxfzn0rawimiaztglxaq-basic-app";
private const string urn = "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6anV6eWRhaWYyNWNpYXhmem4wcmF3aW1pYXp0Z2x4YXEtYmFzaWMtYXBwL2RvaXQucnZ0";

public record Token(string AccessToken, DateTime ExpiresAt);

[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
public static async Task ClassInitializeAsync(TestContext testContext)
{
dynamic auth = await new TwoLeggedApi().AuthenticateAsync(_clientId, _clientSecret, "client_credentials", new Scope[] { Scope.BucketCreate, Scope.BucketRead, Scope.DataRead, Scope.DataWrite, Scope.DataCreate });

Console.WriteLine(auth.ToString());
token = auth.access_token;
SDKManager sdkManager = SdkManagerBuilder
.Create() // Creates SDK Manager Builder itself.
.Add(new ApsConfiguration()
{
//option to override base address
// BaseAddress = new Uri("https://developer.api.autodesk.com/modelderivative/v2/")
}
)
.Add(ResiliencyConfiguration.CreateDefault())
.Build();
ossApi =new OssApi (sdkManager);

}



// [TestMethod]
// public async Task TestFormatsAsync()
// {

// Formats formats = await _mdApi.FormatsAsync(authorizationToken: token);
// Assert.IsTrue(formats.SupportedFormats.Count() == 10);
// }

// [TestMethod]
// public async Task TestJobAsync()
// {
// // set output formats
// List<JobPayloadFormat> outputFormats = new List<JobPayloadFormat>()
// {
// // initialising an Svf2 output class will automatically set the type to Svf2.
// // No need to call Type = TypeEnum.Svf2
// new JobSvf2OutputFormat()
// {

// Views = new List<ViewsEnum>()
// {
// ViewsEnum._2d,
// ViewsEnum._3d
// },

// },

// // initialising a Thumbnail output class will automatically set the type to Thumbnail.
// // No need to call Type = TypeEnum.Thumbnail
// new JobThumbnailOutputFormat()
// {
// Advanced = new JobThumbnailOutputFormatAdvanced(){

// Width = WidthEnum.NUMBER_100,
// Height = HeightEnum.NUMBER_100
// }


// }

// };


// // specify Job details
// JobPayload Job = new JobPayload()
// {
// Input = new JobPayloadInput()
// {
// Urn =urn ,
// CompressedUrn = false,
// RootFilename = "Result (9).ipt",



// },
// Output = new JobPayloadOutput()
// {
// Formats = outputFormats,
// Destination = RegionEnum.US
// },



// };

// // start the translation job
// string jobUrn;
// string jobResult ;
// Job jobResponse=null!;
// try
// {
// jobResponse = await _mdApi.StartJobAsync(jobPayload: Job, accessToken: token);
// // query for urn, result etc...
// jobUrn = jobResponse.Urn;
// jobResult = jobResponse.Result;
// }
// catch
// (Exception ex)
// {
// Console.WriteLine(ex.Message);
// }
// Assert.IsTrue(jobResponse.Result == "created");
// }

[TestMethod]
public async Task TestGetbucktes()
{
Expand Down
Binary file added bin/Debug/net6.0/Autodesk.Forge.dll
Binary file not shown.
35 changes: 35 additions & 0 deletions bin/Debug/net6.0/BetaTest.deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
".NETCoreApp,Version=v6.0": {
"BetaTest/1.0.0": {
"dependencies": {
"Autodesk.Forge": "1.9.7",
"Autodesk.Oss": "1.0.0-beta2",
"Autodesk.SDKManager": "1.0.0-beta1",
"MSTest.TestAdapter": "2.2.8",
Expand All @@ -20,6 +21,18 @@
"BetaTest.dll": {}
}
},
"Autodesk.Forge/1.9.7": {
"dependencies": {
"Newtonsoft.Json": "13.0.1",
"RestSharp": "108.0.1"
},
"runtime": {
"lib/netstandard2.0/Autodesk.Forge.dll": {
"assemblyVersion": "1.9.7.0",
"fileVersion": "1.9.7.0"
}
}
},
"Autodesk.Forge.Core.NetStandard/2.0.0": {
"dependencies": {
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1",
Expand Down Expand Up @@ -637,6 +650,14 @@
}
}
},
"RestSharp/108.0.1": {
"runtime": {
"lib/net6.0/RestSharp.dll": {
"assemblyVersion": "108.0.1.0",
"fileVersion": "108.0.1.0"
}
}
},
"runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {},
"runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {},
"runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {},
Expand Down Expand Up @@ -1286,6 +1307,13 @@
"serviceable": false,
"sha512": ""
},
"Autodesk.Forge/1.9.7": {
"type": "package",
"serviceable": true,
"sha512": "sha512-GAjHStJHUAJ2B3XhZ6iB6d6ZOUyYj70uUrX4eGmZxTR64jr7CKnwPD3o/zDVI7piQgpQ+JuswPiNk7/90pitQg==",
"path": "autodesk.forge/1.9.7",
"hashPath": "autodesk.forge.1.9.7.nupkg.sha512"
},
"Autodesk.Forge.Core.NetStandard/2.0.0": {
"type": "package",
"serviceable": true,
Expand Down Expand Up @@ -1531,6 +1559,13 @@
"path": "polly/7.2.3",
"hashPath": "polly.7.2.3.nupkg.sha512"
},
"RestSharp/108.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-XKwuwWq7A4dxZ8l9QkS2+ePLJ9ImmLaJSeFO6H2kpII4Us4n1NRs4w3c//8H2BYpL1XqBE8nmsd9aNCVBwXmOA==",
"path": "restsharp/108.0.1",
"hashPath": "restsharp.108.0.1.nupkg.sha512"
},
"runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {
"type": "package",
"serviceable": true,
Expand Down
Binary file modified bin/Debug/net6.0/BetaTest.dll
Binary file not shown.
Binary file modified bin/Debug/net6.0/BetaTest.pdb
Binary file not shown.
Binary file added bin/Debug/net6.0/RestSharp.dll
Binary file not shown.
4 changes: 4 additions & 0 deletions obj/BetaTest.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
"net6.0": {
"targetAlias": "net6.0",
"dependencies": {
"Autodesk.Forge": {
"target": "Package",
"version": "[1.9.7, )"
},
"Autodesk.Oss": {
"target": "Package",
"version": "[1.0.0-beta2, )"
Expand Down
Binary file modified obj/Debug/net6.0/BetaTest.assets.cache
Binary file not shown.
Binary file modified obj/Debug/net6.0/BetaTest.csproj.AssemblyReference.cache
Binary file not shown.
2 changes: 1 addition & 1 deletion obj/Debug/net6.0/BetaTest.csproj.CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c50141e74bbc07eebb99cc23c1e98824973c0c10
1c128609bc4492dc9e03617e42f558aa127c1fb6
2 changes: 2 additions & 0 deletions obj/Debug/net6.0/BetaTest.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\BetaTest.deps.jso
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\BetaTest.runtimeconfig.json
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\BetaTest.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\BetaTest.pdb
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\Autodesk.Forge.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\Autodesk.Forge.Core.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\Autodesk.Oss.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\Autodesk.Sdk.Manager.dll
Expand Down Expand Up @@ -42,6 +43,7 @@ C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\Microsoft.VisualS
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\Newtonsoft.Json.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\NuGet.Frameworks.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\Polly.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\RestSharp.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\cs\Microsoft.TestPlatform.CoreUtilities.resources.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\cs\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
C:\Users\srivasr\Downloads\BetaTest3\BetaTest\bin\Debug\net6.0\de\Microsoft.TestPlatform.CoreUtilities.resources.dll
Expand Down
Binary file modified obj/Debug/net6.0/BetaTest.dll
Binary file not shown.
Binary file modified obj/Debug/net6.0/BetaTest.pdb
Binary file not shown.
Binary file modified obj/Debug/net6.0/ref/BetaTest.dll
Binary file not shown.
Binary file modified obj/Debug/net6.0/refint/BetaTest.dll
Binary file not shown.
73 changes: 68 additions & 5 deletions obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
"version": 3,
"targets": {
"net6.0": {
"Autodesk.Forge/1.9.7": {
"type": "package",
"dependencies": {
"Newtonsoft.Json": "13.0.1",
"RestSharp": "108.0.1"
},
"compile": {
"lib/netstandard2.0/Autodesk.Forge.dll": {}
},
"runtime": {
"lib/netstandard2.0/Autodesk.Forge.dll": {}
}
},
"Autodesk.Forge.Core.NetStandard/2.0.0": {
"type": "package",
"dependencies": {
Expand Down Expand Up @@ -813,6 +826,19 @@
}
}
},
"RestSharp/108.0.1": {
"type": "package",
"compile": {
"lib/net6.0/RestSharp.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net6.0/RestSharp.dll": {
"related": ".xml"
}
}
},
"runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {
"type": "package",
"runtimeTargets": {
Expand Down Expand Up @@ -2139,6 +2165,20 @@
}
},
"libraries": {
"Autodesk.Forge/1.9.7": {
"sha512": "GAjHStJHUAJ2B3XhZ6iB6d6ZOUyYj70uUrX4eGmZxTR64jr7CKnwPD3o/zDVI7piQgpQ+JuswPiNk7/90pitQg==",
"type": "package",
"path": "autodesk.forge/1.9.7",
"files": [
".nupkg.metadata",
".signature.p7s",
"autodesk.forge.1.9.7.nupkg.sha512",
"autodesk.forge.nuspec",
"lib/net48/Autodesk.Forge.dll",
"lib/netstandard2.0/Autodesk.Forge.dll",
"logo_forge-2-line.png"
]
},
"Autodesk.Forge.Core.NetStandard/2.0.0": {
"sha512": "eNdgNhz74Cv7c6iGf2QtEULZn3a/OuvckN429Xuc9ZEUrA+BdSPM3IC6duSNQXMs7vBqD9mosOgTIh6pjoSZmw==",
"type": "package",
Expand Down Expand Up @@ -3701,6 +3741,24 @@
"polly.nuspec"
]
},
"RestSharp/108.0.1": {
"sha512": "XKwuwWq7A4dxZ8l9QkS2+ePLJ9ImmLaJSeFO6H2kpII4Us4n1NRs4w3c//8H2BYpL1XqBE8nmsd9aNCVBwXmOA==",
"type": "package",
"path": "restsharp/108.0.1",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/net5.0/RestSharp.dll",
"lib/net5.0/RestSharp.xml",
"lib/net6.0/RestSharp.dll",
"lib/net6.0/RestSharp.xml",
"lib/netstandard2.0/RestSharp.dll",
"lib/netstandard2.0/RestSharp.xml",
"restsharp.108.0.1.nupkg.sha512",
"restsharp.nuspec",
"restsharp.png"
]
},
"runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {
"sha512": "HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==",
"type": "package",
Expand Down Expand Up @@ -7103,6 +7161,7 @@
},
"projectFileDependencyGroups": {
"net6.0": [
"Autodesk.Forge >= 1.9.7",
"Autodesk.Oss >= 1.0.0-beta2",
"Autodesk.SdkManager >= 1.0.0-beta1",
"MSTest.TestAdapter >= 2.2.8",
Expand All @@ -7118,21 +7177,21 @@
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\BetaTest.csproj",
"projectUniqueName": "c:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\BetaTest.csproj",
"projectName": "BetaTest",
"projectPath": "C:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\BetaTest.csproj",
"projectPath": "c:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\BetaTest.csproj",
"packagesPath": "C:\\Users\\srivasr\\.nuget\\packages\\",
"outputPath": "C:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\obj\\",
"outputPath": "c:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\NuGet.Config",
"c:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\NuGet.Config",
"C:\\Users\\srivasr\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\packages": {},
"c:\\Users\\srivasr\\Downloads\\BetaTest3\\BetaTest\\packages": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
Expand All @@ -7151,6 +7210,10 @@
"net6.0": {
"targetAlias": "net6.0",
"dependencies": {
"Autodesk.Forge": {
"target": "Package",
"version": "[1.9.7, )"
},
"Autodesk.Oss": {
"target": "Package",
"version": "[1.0.0-beta2, )"
Expand Down
Loading

0 comments on commit f29c4a4

Please sign in to comment.