a2zdeploy 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,33 @@
1
+ require_relative '../github_api'
2
+ require_relative '../globalconstants'
3
+
4
+ require 'test/unit'
5
+
6
+ class TestGithubApi < Test::Unit::TestCase
7
+
8
+ def test_returns_head_hash_when_branch_exists
9
+
10
+ Dir.chdir GlobalConstants::SPEC if File.basename(Dir.pwd) != GlobalConstants::SPEC
11
+
12
+ # checkout fresh repo
13
+ GithubApi.CheckoutRepoAfresh 'http://ndhaxpgit01.mckesson.com/SureshBatta/AutoUpgradeTestProject.git', 'maste`r'
14
+ ret = GithubApi.DoesBranchExist 'origin', 'master'
15
+ assert_not_equal '', ret
16
+
17
+ Dir.chdir '..'
18
+ end
19
+
20
+ def test_returns_head_hash_when_branch_does_not_exists
21
+
22
+ Dir.chdir GlobalConstants::SPEC if File.basename(Dir.pwd) != GlobalConstants::SPEC
23
+
24
+ # checkout fresh repo
25
+ GithubApi.CheckoutRepoAfresh 'http://ndhaxpgit01.mckesson.com/SureshBatta/AutoUpgradeTestProject.git', 'master'
26
+ ret = GithubApi.DoesBranchExist 'origin', 'test'
27
+ assert_equal '', ret
28
+
29
+ Dir.chdir '..'
30
+
31
+ end
32
+
33
+ end
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <packages>
3
+ <package id="Autofac" version="3.5.2" targetFramework="net45"/>
4
+ <package id="Fooidity" version="1.0.1" targetFramework="net45"/>
5
+ <package id="Fooidity.Autofac" version="1.0.1" targetFramework="net45"/>
6
+ <package id="Google.ProtocolBuffers" version="2.4.1.521" targetFramework="net45"/>
7
+ <package id="MassTransit" version="3.0.15" targetFramework="net45"/>
8
+ <package id="Microsoft.AspNet.Cors" version="5.2.3" targetFramework="net45"/>
9
+ <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net45"/>
10
+ <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45"/>
11
+ <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45"/>
12
+ <package id="Microsoft.AspNet.WebApi.Cors" version="5.2.3" targetFramework="net45"/>
13
+ <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45"/>
14
+ <package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.14.201151115" targetFramework="net45"/>
15
+ <package id="NewId" version="2.1.3" targetFramework="net45"/>
16
+ <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45"/>
17
+ <package id="RelayHealth.DataPlatform.Contracts" version="24.5.1" targetFramework="net45"/>
18
+ <package id="RelayHealth.DataPlatform.Framework" version="24.5.1" targetFramework="net45"/>
19
+ <package id="RelayHealth.DataPlatform.Framework.Messaging" version="24.5.1" targetFramework="net45"/>
20
+ <package id="RelayHealth.DataPlatform.Framework.Web" version="24.5.1" targetFramework="net45"/>
21
+ <package id="RelayHealth.DataPlatform.Identity" version="24.5.1" targetFramework="net45"/>
22
+ <package id="RelayHealth.DataPlatform.Management" version="24.5.1" targetFramework="net45"/>
23
+ <package id="RelayHealth.DataPlatform.Management.Tools" version="24.5.1" targetFramework="net45"/>
24
+ </packages>
@@ -0,0 +1,206 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0" DefaultTargets="Build">
3
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
4
+ <PropertyGroup>
5
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+ <ProjectGuid>{96255D6B-109D-4B0F-842B-1F6C9607E50F}</ProjectGuid>
8
+ <OutputType>Library</OutputType>
9
+ <AppDesignerFolder>Properties</AppDesignerFolder>
10
+ <RootNamespace>RelayHealth.DataPlatform.Service.Test</RootNamespace>
11
+ <AssemblyName>RelayHealth.DataPlatform.Service.Test</AssemblyName>
12
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13
+ <FileAlignment>512</FileAlignment>
14
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
15
+ </PropertyGroup>
16
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17
+ <DebugSymbols>true</DebugSymbols>
18
+ <DebugType>full</DebugType>
19
+ <Optimize>false</Optimize>
20
+ <OutputPath>bin\Debug\</OutputPath>
21
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
22
+ <ErrorReport>prompt</ErrorReport>
23
+ <WarningLevel>4</WarningLevel>
24
+ </PropertyGroup>
25
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26
+ <DebugType>pdbonly</DebugType>
27
+ <Optimize>true</Optimize>
28
+ <OutputPath>bin\Release\</OutputPath>
29
+ <DefineConstants>TRACE</DefineConstants>
30
+ <ErrorReport>prompt</ErrorReport>
31
+ <WarningLevel>4</WarningLevel>
32
+ </PropertyGroup>
33
+ <ItemGroup>
34
+ <Reference Include="Autofac">
35
+ <HintPath>..\packages\Autofac.3.5.2\lib\net40\Autofac.dll</HintPath>
36
+ <Private>True</Private>
37
+ </Reference>
38
+ <Reference Include="Fooidity">
39
+ <HintPath>..\packages\Fooidity.1.0.1\lib\net45\Fooidity.dll</HintPath>
40
+ <Private>True</Private>
41
+ </Reference>
42
+ <Reference Include="Fooidity.AutofacIntegration">
43
+ <HintPath>..\packages\Fooidity.Autofac.1.0.1\lib\net45\Fooidity.AutofacIntegration.dll</HintPath>
44
+ <Private>True</Private>
45
+ </Reference>
46
+ <Reference Include="Google.ProtocolBuffers">
47
+ <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll</HintPath>
48
+ </Reference>
49
+ <Reference Include="Google.ProtocolBuffers.Serialization">
50
+ <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.Serialization.dll</HintPath>
51
+ </Reference>
52
+ <Reference Include="MassTransit">
53
+ <HintPath>..\packages\MassTransit.3.0.15\lib\net45\MassTransit.dll</HintPath>
54
+ <Private>True</Private>
55
+ </Reference>
56
+ <Reference Include="MassTransit.TestFramework">
57
+ <HintPath>..\packages\MassTransit.TestFramework.3.0.15\lib\net45\MassTransit.TestFramework.dll</HintPath>
58
+ <Private>True</Private>
59
+ </Reference>
60
+ <Reference Include="Microsoft.Data.Edm">
61
+ <SpecificVersion>False</SpecificVersion>
62
+ <HintPath>..\packages\Microsoft.Data.Edm.5.6.3\lib\net40\Microsoft.Data.Edm.dll</HintPath>
63
+ </Reference>
64
+ <Reference Include="Microsoft.Data.OData">
65
+ <SpecificVersion>False</SpecificVersion>
66
+ <HintPath>..\packages\Microsoft.Data.OData.5.6.3\lib\net40\Microsoft.Data.OData.dll</HintPath>
67
+ </Reference>
68
+ <Reference Include="Microsoft.Data.Services.Client">
69
+ <SpecificVersion>False</SpecificVersion>
70
+ <HintPath>..\packages\Microsoft.Data.Services.Client.5.6.3\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
71
+ </Reference>
72
+ <Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
73
+ <HintPath>..\packages\RelayHealth.DataPlatform.Management.Tools.24.5.1\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
74
+ <Private>True</Private>
75
+ </Reference>
76
+ <Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
77
+ <HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
78
+ </Reference>
79
+ <Reference Include="Microsoft.WindowsAzure.Configuration">
80
+ <SpecificVersion>False</SpecificVersion>
81
+ <HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
82
+ </Reference>
83
+ <Reference Include="Microsoft.WindowsAzure.Storage">
84
+ <HintPath>..\packages\WindowsAzure.Storage.4.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
85
+ </Reference>
86
+ <Reference Include="NewId">
87
+ <HintPath>..\packages\NewId.2.1.3\lib\net45\NewId.dll</HintPath>
88
+ </Reference>
89
+ <Reference Include="Newtonsoft.Json">
90
+ <SpecificVersion>False</SpecificVersion>
91
+ <HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
92
+ </Reference>
93
+ <Reference Include="nunit.framework">
94
+ <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
95
+ </Reference>
96
+ <Reference Include="RelayHealth.DataPlatform.Contracts">
97
+ <HintPath>..\packages\RelayHealth.DataPlatform.Contracts.24.5.1\lib\net45\RelayHealth.DataPlatform.Contracts.dll</HintPath>
98
+ <Private>True</Private>
99
+ </Reference>
100
+ <Reference Include="RelayHealth.DataPlatform.Core">
101
+ <HintPath>..\packages\RelayHealth.DataPlatform.Test.24.5.1\lib\net45\RelayHealth.DataPlatform.Core.dll</HintPath>
102
+ <Private>True</Private>
103
+ </Reference>
104
+ <Reference Include="RelayHealth.DataPlatform.Framework">
105
+ <HintPath>..\packages\RelayHealth.DataPlatform.Management.Tools.24.5.1\lib\net45\RelayHealth.DataPlatform.Framework.dll</HintPath>
106
+ <Private>True</Private>
107
+ </Reference>
108
+ <Reference Include="RelayHealth.DataPlatform.Framework.Messaging">
109
+ <HintPath>..\packages\RelayHealth.DataPlatform.Framework.Messaging.24.5.1\lib\net45\RelayHealth.DataPlatform.Framework.Messaging.dll</HintPath>
110
+ <Private>True</Private>
111
+ </Reference>
112
+ <Reference Include="RelayHealth.DataPlatform.Identity">
113
+ <HintPath>..\packages\RelayHealth.DataPlatform.Identity.24.5.1\lib\net45\RelayHealth.DataPlatform.Identity.dll</HintPath>
114
+ <Private>True</Private>
115
+ </Reference>
116
+ <Reference Include="RelayHealth.DataPlatform.Management">
117
+ <HintPath>..\packages\RelayHealth.DataPlatform.Management.Tools.24.5.1\lib\net45\RelayHealth.DataPlatform.Management.dll</HintPath>
118
+ <Private>True</Private>
119
+ </Reference>
120
+ <Reference Include="RelayHealth.DataPlatform.Runtime">
121
+ <HintPath>..\packages\RelayHealth.DataPlatform.Test.Messaging.24.5.1\lib\net45\RelayHealth.DataPlatform.Runtime.dll</HintPath>
122
+ <Private>True</Private>
123
+ </Reference>
124
+ <Reference Include="RelayHealth.DataPlatform.Storage">
125
+ <HintPath>..\packages\RelayHealth.DataPlatform.Test.24.5.1\lib\net45\RelayHealth.DataPlatform.Storage.dll</HintPath>
126
+ <Private>True</Private>
127
+ </Reference>
128
+ <Reference Include="RelayHealth.DataPlatform.Test">
129
+ <HintPath>..\packages\RelayHealth.DataPlatform.Test.24.5.1\lib\net45\RelayHealth.DataPlatform.Test.dll</HintPath>
130
+ <Private>True</Private>
131
+ </Reference>
132
+ <Reference Include="RelayHealth.DataPlatform.Test.Messaging">
133
+ <HintPath>..\packages\RelayHealth.DataPlatform.Test.Messaging.24.5.1\lib\net45\RelayHealth.DataPlatform.Test.Messaging.dll</HintPath>
134
+ <Private>True</Private>
135
+ </Reference>
136
+ <Reference Include="RelayHealth.Shared">
137
+ <HintPath>..\packages\RelayHealth.Shared.1.9.0\lib\net45\RelayHealth.Shared.dll</HintPath>
138
+ </Reference>
139
+ <Reference Include="System"/>
140
+ <Reference Include="System.Core"/>
141
+ <Reference Include="System.Net.Http"/>
142
+ <Reference Include="System.Net.Http.Formatting">
143
+ <SpecificVersion>False</SpecificVersion>
144
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
145
+ </Reference>
146
+ <Reference Include="System.Spatial">
147
+ <SpecificVersion>False</SpecificVersion>
148
+ <HintPath>..\packages\System.Spatial.5.6.3\lib\net40\System.Spatial.dll</HintPath>
149
+ </Reference>
150
+ <Reference Include="System.Web.Cors">
151
+ <HintPath>..\packages\Microsoft.AspNet.Cors.5.2.3\lib\net45\System.Web.Cors.dll</HintPath>
152
+ </Reference>
153
+ <Reference Include="System.Web.Http">
154
+ <SpecificVersion>False</SpecificVersion>
155
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
156
+ </Reference>
157
+ <Reference Include="System.Web.Http.Cors">
158
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.Cors.5.2.3\lib\net45\System.Web.Http.Cors.dll</HintPath>
159
+ </Reference>
160
+ <Reference Include="System.Web.Http.WebHost">
161
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
162
+ <Private>True</Private>
163
+ </Reference>
164
+ <Reference Include="System.Xml.Linq"/>
165
+ <Reference Include="System.Data.DataSetExtensions"/>
166
+ <Reference Include="Microsoft.CSharp"/>
167
+ <Reference Include="System.Data"/>
168
+ <Reference Include="System.Xml"/>
169
+ </ItemGroup>
170
+ <ItemGroup>
171
+ <Compile Include="ControllerTestFixture.cs"/>
172
+ <Compile Include="ControllerTests.cs"/>
173
+ <Compile Include="Properties\AssemblyInfo.cs"/>
174
+ </ItemGroup>
175
+ <ItemGroup>
176
+ <None Include="app.config">
177
+ <SubType>Designer</SubType>
178
+ </None>
179
+ <None Include="packages.config">
180
+ <SubType>Designer</SubType>
181
+ </None>
182
+ <None Include="protos\google\protobuf\csharp_options.proto"/>
183
+ <None Include="protos\google\protobuf\descriptor.proto"/>
184
+ </ItemGroup>
185
+ <ItemGroup>
186
+ <ProjectReference Include="..\RelayHealth.DataPlatform.Service.Contracts\RelayHealth.DataPlatform.Service.Contracts.csproj">
187
+ <Project>{3b3c0955-d132-4d88-9322-3163e4f6a616}</Project>
188
+ <Name>RelayHealth.DataPlatform.Service.Contracts</Name>
189
+ </ProjectReference>
190
+ <ProjectReference Include="..\RelayHealth.DataPlatform.Service\RelayHealth.DataPlatform.Service.csproj">
191
+ <Project>{2c0781a0-f99e-4a02-b968-c3b4ff5e2896}</Project>
192
+ <Name>RelayHealth.DataPlatform.Service</Name>
193
+ </ProjectReference>
194
+ </ItemGroup>
195
+ <ItemGroup>
196
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}"/>
197
+ </ItemGroup>
198
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
199
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
200
+ Other similar extension points exist, see Microsoft.Common.targets.
201
+ <Target Name="BeforeBuild">
202
+ </Target>
203
+ <Target Name="AfterBuild">
204
+ </Target>
205
+ -->
206
+ </Project>
@@ -0,0 +1,215 @@
1
+ require_relative '../upgrade'
2
+ require_relative '../version_map'
3
+ require_relative '../github_api'
4
+ require_relative '../globalconstants'
5
+ require 'test/unit'
6
+
7
+ class TestUpgrade < Test::Unit::TestCase
8
+
9
+
10
+ def test_upgrade_package_version
11
+
12
+ # switch to tests folder with sample packages.config file
13
+ Dir.chdir GlobalConstants::SPEC if File.basename(Dir.pwd) != GlobalConstants::SPEC
14
+
15
+ # checkout DP repo master branch for latest versions to be used for test packages.config file
16
+ vm = VersionMap.new
17
+ repo_url = 'http://ndhaxpgit01.mckesson.com/Carnegie/RelayHealth.DataPlatform.git'
18
+ versions = vm.version_map repo_url, 'master'
19
+
20
+ # switch back to root folder
21
+ #Dir.chdir '..'
22
+ #repo_url = 'http://ndhaxpgit01.mckesson.com/Carnegie/TestService.git'
23
+ #GithubApi.CheckoutRepoAfresh(repo_url, 'develop')
24
+
25
+ pkg_files = Dir.glob '**/packages.config'
26
+
27
+ # upgrade
28
+ up = UpgradePackages.new repo_url, 'develop', versions, {}
29
+ up.replace_package_versions pkg_files
30
+
31
+ # read back packages.config and check for version match
32
+ doc = Nokogiri::XML File.read(pkg_files[0])
33
+ nodes = doc.xpath "//*[@id]"
34
+ nodes.each { |node|
35
+ if (versions.has_key? node['id'])
36
+ puts node['version']
37
+ puts versions[node['id']]
38
+ assert_equal node['version'], versions[node['id']]
39
+ end
40
+ }
41
+
42
+ Dir.chdir '..'
43
+ end
44
+
45
+ def test_upgrade_project_version
46
+
47
+ # switch to tests folder with sample proj file
48
+ Dir.chdir GlobalConstants::SPEC if File.basename(Dir.pwd) != GlobalConstants::SPEC
49
+
50
+ # checkout DP repo master branch for latest versions to be used for test packages.config file
51
+ vm = VersionMap.new
52
+ repo_url = 'http://ndhaxpgit01.mckesson.com/Carnegie/RelayHealth.DataPlatform.git'
53
+ versions = vm.version_map repo_url, 'master'
54
+
55
+ proj_files = ['proj.csproj']
56
+
57
+ # upgrade
58
+ up = UpgradePackages.new repo_url, 'develop', versions, {}
59
+ status = up.replace_project_versions proj_files
60
+
61
+ assert_equal true, status
62
+
63
+ Dir.chdir '..'
64
+ end
65
+
66
+ def test_fail_on_missing_env_vars
67
+
68
+ Dir.chdir GlobalConstants::SPEC if File.basename(Dir.pwd) != GlobalConstants::SPEC
69
+
70
+ # checkout DP repo develop branch for latest versions to be used for test packages.config file
71
+ vm = VersionMap.new
72
+ repo_url = 'http://ndhaxpgit01.mckesson.com/Carnegie/RelayHealth.DataPlatform.git'
73
+ versions = vm.version_map repo_url, 'develop'
74
+
75
+ config_map = {}
76
+
77
+ # upgrade and build
78
+ repo_url = 'http://ndhaxpgit01.mckesson.com/SureshBatta/AutoUpgradeTestProject.git'
79
+ up = UpgradePackages.new repo_url, 'master', versions, config_map
80
+ status = up.Do
81
+ assert_equal false, status
82
+
83
+ Dir.chdir '..'
84
+
85
+ end
86
+
87
+ def test_upgrade_and_rake_build
88
+
89
+ Dir.chdir GlobalConstants::SPEC if File.basename(Dir.pwd) != GlobalConstants::SPEC
90
+
91
+ # checkout DP repo develop branch for latest versions to be used for test packages.config file
92
+ vm = VersionMap.new
93
+ repo_url = 'http://ndhaxpgit01.mckesson.com/Carnegie/RelayHealth.DataPlatform.git'
94
+ versions = vm.version_map repo_url, 'develop'
95
+
96
+ # these are sample env vars
97
+ env_vars = {
98
+ 'env' => 'dev',
99
+ 'ServiceName' => 'rhc-testsvc-dev-x'
100
+ }
101
+ config_map = {}
102
+ config_map['env_vars'] = env_vars
103
+
104
+ # upgrade and build
105
+ repo_url = 'http://ndhaxpgit01.mckesson.com/SureshBatta/AutoUpgradeTestProject.git'
106
+ up = UpgradePackages.new repo_url, 'master', versions, config_map
107
+ status = up.Do
108
+
109
+ Dir.chdir '..'
110
+
111
+ assert_equal true, status
112
+ end
113
+
114
+ def test_project_publishes_nuget_with_single_semver
115
+ Dir.chdir GlobalConstants::SPEC if File.basename(Dir.pwd) != GlobalConstants::SPEC
116
+
117
+ ENV['BUILD_VCS_NUMBER'] = 'vcs_set'
118
+
119
+ vm = VersionMap.new
120
+ repo_url = 'http://ndhaxpgit01.mckesson.com/Carnegie/RelayHealth.DataPlatform.git'
121
+ versions = vm.version_map repo_url, 'develop'
122
+
123
+ config_map = {}
124
+ # these are sample env vars
125
+ env_vars = {
126
+ 'env' => 'dev',
127
+ 'ServiceName' => 'rhc-testsvc-dev-x'
128
+ }
129
+ config_map['env_vars'] = env_vars
130
+ config_map['project'] = 'AutoUpgradeTestProject'
131
+ config_map['metadata'] = {
132
+ 'ShouldPublishNuget' => 'Y',
133
+ 'SemverFile' => '.semver',
134
+ 'SemverDimension' => 'patch'
135
+ }
136
+
137
+ repo_url = 'http://ndhaxpgit01.mckesson.com/SureshBatta/AutoUpgradeTestProject.git'
138
+ up = UpgradePackages.new repo_url, 'develop', versions, config_map
139
+ status = up.Do
140
+
141
+ Dir.chdir '../..'
142
+ delete('BUILD_VCS_NUMBER')
143
+
144
+ assert_equal true, status
145
+ end
146
+
147
+ def test_project_publishes_nuget_with_multiple_semver
148
+ Dir.chdir GlobalConstants::SPEC if File.basename(Dir.pwd) != GlobalConstants::SPEC
149
+
150
+ ENV['BUILD_VCS_NUMBER'] = 'vcs_set'
151
+
152
+ vm = VersionMap.new
153
+ repo_url = 'http://ndhaxpgit01.mckesson.com/Carnegie/RelayHealth.DataPlatform.git'
154
+ versions = vm.version_map repo_url, 'develop'
155
+
156
+ config_map = {}
157
+ # these are sample env vars
158
+ env_vars = {
159
+ 'env' => 'dev',
160
+ 'ServiceName' => 'rhc-testsvc-dev-x'
161
+ }
162
+ config_map['env_vars'] = env_vars
163
+ config_map['project'] = 'RelayHealth.DataPlatform'
164
+ config_map['metadata'] = {
165
+ 'ShouldPublishNuget' => 'Y',
166
+ 'SemverFile' => 'Framework.semver',
167
+ 'SemverDimension' => 'patch',
168
+ 'SemverLocation' => 'versioning'
169
+ }
170
+
171
+ repo_url = 'http://ndhaxpgit01.mckesson.com/ruchikabhatia/RelayHealth.DataPlatform.git'# Change this repo to test project
172
+ up = UpgradePackages.new repo_url, 'breakupbuilds', versions, config_map
173
+
174
+ #status = up.Do -- call this with new test project repo url
175
+
176
+ Dir.chdir '../..'
177
+ #delete('BUILD_VCS_NUMBER')-- call this with new test project repo url
178
+
179
+ #assert_equal true, status -- call this with new test project repo url
180
+ end
181
+
182
+ def test_project_publishes_nuget_fail_for_different_branches
183
+
184
+ end
185
+
186
+ def test_project_does_not_publishes_nuget
187
+ Dir.chdir GlobalConstants::SPEC if File.basename(Dir.pwd) != GlobalConstants::SPEC
188
+
189
+ ENV['BUILD_VCS_NUMBER'] = 'vcs_set'
190
+
191
+ vm = VersionMap.new
192
+ repo_url = 'http://ndhaxpgit01.mckesson.com/Carnegie/RelayHealth.DataPlatform.git'
193
+ versions = vm.version_map repo_url, 'develop'
194
+
195
+ config_map = {}
196
+ # these are sample env vars
197
+ env_vars = {
198
+ 'env' => 'dev',
199
+ 'ServiceName' => 'rhc-testsvc-dev-x'
200
+ }
201
+ config_map['env_vars'] = env_vars
202
+ config_map['metadata'] = {
203
+ 'ShouldPublishNuget' => 'n'
204
+ }
205
+ repo_url = 'http://ndhaxpgit01.mckesson.com/SureshBatta/AutoUpgradeTestProject.git'
206
+ up = UpgradePackages.new repo_url, 'develop', versions, config_map
207
+ status = up.Do
208
+
209
+ Dir.chdir '../..'
210
+ delete('BUILD_VCS_NUMBER')
211
+
212
+ assert_equal true, status
213
+ end
214
+
215
+ end