-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-5788: Replace cake with dotnet cli scripts #1821
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
Changes from all commits
fd1ff36
13a225c
85afd61
0481cd1
126f115
a2da42d
43b1930
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # add/adjust nuget.config pointing to myget so intermediate versions could be restored | ||
| if [ -f "./nuget.config" ]; then | ||
| echo "Adding myget into nuget.config" | ||
| NUGET_SOURCES=$(dotnet nuget list source --format short) | ||
| if [[ ${NUGET_SOURCES} != *"https://www.myget.org/F/mongodb/api/v3/index.json"* ]];then | ||
| dotnet nuget add source https://www.myget.org/F/mongodb/api/v3/index.json -n myget.org --configfile ./nuget.config | ||
| fi | ||
| else | ||
| echo "Creating custom nuget.config" | ||
| cat > "nuget.config" << EOL | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <packageSources> | ||
| <clear /> | ||
| <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> | ||
| <add key="myget.org" value="https://www.myget.org/F/mongodb/api/v3/index.json" /> | ||
| </packageSources> | ||
| </configuration> | ||
| EOL | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| SMOKE_TESTS_PROJECT="./tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/MongoDB.Driver.SmokeTests.Sdk.csproj" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll probably need few smoke tests projects, so need to be ready for that.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea is: we should not build another projects (like a driver or bson library). For now we have only one project, in case we will have more then one - we can make a loop in bash script, and maintain either list of projects, or we can do a glob-filter by folder. |
||
|
|
||
| DRIVER_PACKAGE_VERSION="$1" | ||
| if [ -z "$DRIVER_PACKAGE_VERSION" ]; then | ||
| echo "Driver package version should be provided." | ||
| exit 1 | ||
| fi | ||
|
|
||
| . ./evergreen/append-myget-package-source.sh | ||
|
|
||
| export DRIVER_PACKAGE_VERSION="${DRIVER_PACKAGE_VERSION}" | ||
| . ./evergreen/compile-sources.sh "$SMOKE_TESTS_PROJECT" | ||
|
|
||
| dotnet test "$SMOKE_TESTS_PROJECT" -c Release --no-build -f "$FRAMEWORK" --results-directory ./build/test-results --logger "junit;verbosity=detailed;LogFileName=TEST-{assembly}.xml;FailureBodyFormat=Verbose" --logger "console;verbosity=detailed" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /* Copyright 2010-present MongoDB Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| using System; | ||
| using System.Reflection; | ||
| using FluentAssertions; | ||
| using MongoDB.Driver.Encryption; | ||
| using Xunit; | ||
| using Xunit.Sdk; | ||
|
|
||
| namespace MongoDB.Driver.SmokeTests.Sdk | ||
| { | ||
| public class ValidatePackagesVersionTests | ||
| { | ||
| private readonly string _packageVersion; | ||
|
|
||
| public ValidatePackagesVersionTests() | ||
| { | ||
| _packageVersion = Environment.GetEnvironmentVariable("DRIVER_PACKAGE_VERSION"); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void ValidateDriverPackageVersion() => | ||
| ValidateAssemblyInformationalVersion(typeof(MongoClient).Assembly, _packageVersion); | ||
|
|
||
| [Fact] | ||
| public void ValidateEncryptionPackageVersion() => | ||
| ValidateAssemblyInformationalVersion(typeof(ClientEncryption).Assembly, _packageVersion); | ||
|
|
||
| private static void ValidateAssemblyInformationalVersion(Assembly assembly, string expectedVersion) | ||
| { | ||
| if (string.IsNullOrEmpty(expectedVersion)) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| var assemblyInformationAttribute = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>(); | ||
| assemblyInformationAttribute.Should().NotBeNull(); | ||
| assemblyInformationAttribute.InformationalVersion.Should().StartWith(expectedVersion); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1