fiftyone.geolocation 4.3.1 → 4.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/ci/common-ci/.github/labels.yml +24 -1
  2. package/ci/common-ci/.github/workflows/sync-labels.yml +2 -0
  3. package/ci/common-ci/CiTips.md +30 -1
  4. package/ci/common-ci/README.md +73 -12
  5. package/ci/common-ci/build-and-test.yml +6 -1
  6. package/ci/common-ci/cloud-release-config.json +51 -0
  7. package/ci/common-ci/dotnet/shared-extract-and-publish-packages.yml +1 -5
  8. package/ci/common-ci/go/shared-go-list-stage.yml +64 -0
  9. package/ci/common-ci/java/readme.md +15 -1
  10. package/ci/common-ci/php/readme.md +15 -0
  11. package/ci/common-ci/release-config-schema.json +52 -0
  12. package/ci/common-ci/release-config-template.json +50 -1
  13. package/ci/common-ci/release-config.json +47 -189
  14. package/ci/common-ci/scripts/azure/checkSlot.ps1 +28 -0
  15. package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.psm1 +12 -5
  16. package/ci/common-ci/scripts/modules/51DDeployModule/51DDeployModule.psm1 +66 -0
  17. package/ci/common-ci/scripts/modules/51DDownloadDataFileModule/51DDownloadDataFileModule.psm1 +58 -0
  18. package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.psm1 +8 -8
  19. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.Tests.ps1 +347 -9
  20. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.psm1 +285 -54
  21. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.Tests.ps1 +9 -8
  22. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.psm1 +30 -13
  23. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.Tests.ps1 +342 -97
  24. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.psm1 +36 -2
  25. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/SharedVariables.psm1 +2 -2
  26. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-deploy-test-env-config.json +290 -0
  27. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-test-env-config.json +260 -0
  28. package/ci/common-ci/scripts/modules/AzurePortalModules/51DApplicationInsightsModule/51DApplicationInsightsModule.psm1 +104 -0
  29. package/ci/common-ci/scripts/modules/AzurePortalModules/51DChecksModule/51DChecksModule.psm1 +68 -0
  30. package/ci/common-ci/scripts/modules/AzurePortalModules/51DCloudModule/51DCloudModule.psm1 +155 -0
  31. package/ci/common-ci/scripts/modules/AzurePortalModules/51DConnectAzureModule/51DConnectAzureModule.psm1 +45 -0
  32. package/ci/common-ci/scripts/modules/AzurePortalModules/51DSSLBindingsModule/51DSSLBIndingsModule.psm1 +100 -0
  33. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStagingSlotModule/51DStagingSlotModule.psm1 +50 -0
  34. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStorageAccountModule/51DStorageAccountModule.psm1 +248 -0
  35. package/ci/common-ci/scripts/modules/AzurePortalModules/51DTrafficManagerModule/51DTrafficManagerModule.psm1 +58 -0
  36. package/ci/common-ci/shared-auto-complete-pr-stage.yml +16 -3
  37. package/ci/common-ci/shared-create-tag-job.yml +9 -0
  38. package/ci/common-ci/shared-docker-build-steps.yml +34 -0
  39. package/ci/common-ci/shared-docker-push-steps.yml +32 -0
  40. package/ci/common-ci/shared-docker-test-http-steps.yml +69 -0
  41. package/ci/common-ci/shared-git-version-job.yml +17 -2
  42. package/ci/common-ci/shared-publish-github-stage.yml +54 -51
  43. package/ci/common-ci/shared-submodule-trigger-stage.yml +56 -4
  44. package/ci/shared-build-and-test-stage.yml +5 -2
  45. package/examples/examples.test.js +3 -3
  46. package/geoLocationPipelineBuilder.js +9 -16
  47. package/package.json +11 -7
  48. package/setup.js +1 -0
@@ -494,121 +494,366 @@ InModuleScope ReleaseVerifier {
494
494
  }
495
495
 
496
496
  Describe 'Test-DotnetPackageDependencies' {
497
- It 'all package dependencies are up to date with syntax `<PackageReference `/`>' {
498
- $depRepo = "dependent-dotnet"
499
- $repoName = "test-dotnet"
500
- $repoConfigStr = @"
501
- {
502
- "version": "4.3.0",
503
- "packageName": "test.dotnet",
504
- "dependencies": [
505
- "$depRepo"
506
- ]
507
- }
508
- "@
509
- $repoConfig = $repoConfigStr | ConvertFrom-Json
510
- $reposStr = @"
511
- {
512
- "$repoName": $repoConfigStr,
513
- "$depRepo": {
497
+ BeforeAll {
498
+ function Test-DotnetPackageDependenciesOnelineBase {
499
+ param (
500
+ [string]$ExpectedVersion,
501
+ [string]$ActualVersion,
502
+ [string]$ConfigDepPackageName,
503
+ [string]$ActualDepPackageName,
504
+ [boolean]$ExpectedResult
505
+ )
506
+ $depRepo = "dependent-dotnet"
507
+ $repoName = "test-dotnet"
508
+ $repoConfigStr = @"
509
+ {
514
510
  "version": "4.3.0",
515
- "packageName": "dep.dotnet"
511
+ "packageName": "test.dotnet",
512
+ "dependencies": [
513
+ "$depRepo"
514
+ ]
516
515
  }
517
- }
518
516
  "@
519
- $repos = $reposStr | ConvertFrom-Json
520
-
521
- Mock Test-Path { return $true } `
522
- -ModuleName ReleaseVerifier
523
- Mock Get-ChildItem { return @($('{ "FullName": "file1" }' | ConvertFrom-Json)) } `
524
- -ModuleName ReleaseVerifier
525
- Mock Get-Content { return '<PackageReference Include="dep.dotnet" Version="4.3.0" />' } `
526
- -ModuleName ReleaseVerifier
517
+ $repoConfig = $repoConfigStr | ConvertFrom-Json
518
+ $reposStr = @"
519
+ {
520
+ "$repoName": $repoConfigStr,
521
+ "$depRepo": {
522
+ "version": "$ExpectedVersion",
523
+ "packageName": "$ConfigDepPackageName"
524
+ }
525
+ }
526
+ "@
527
+ $repos = $reposStr | ConvertFrom-Json
528
+
529
+ Mock Test-Path { return $true } `
530
+ -ModuleName ReleaseVerifier
531
+ Mock Get-ChildItem { return @($('{ "FullName": "file1.csproj" }' | ConvertFrom-Json)) } `
532
+ -ModuleName ReleaseVerifier
533
+ Mock Get-Content { return "<PackageReference Include=`"$ActualDepPackageName)`" Version=`"$ActualVersion`" />" } `
534
+ -ModuleName ReleaseVerifier
535
+
536
+ $result = Test-DotnetPackageDependencies `
537
+ -RepositoryName $repoName `
538
+ -RepositoryConfig $repoConfig `
539
+ -Repositories $repos
540
+
541
+ $result | Should -BeExactly $ExpectedResult
542
+ }
527
543
 
528
- $result = Test-DotnetPackageDependencies `
529
- -RepositoryName $repoName `
530
- -RepositoryConfig $repoConfig `
531
- -Repositories $repos
544
+ function Test-DotnetPackageDependenciesOneline {
545
+ param (
546
+ [string]$ExpectedVersion,
547
+ [string]$ActualVersion,
548
+ [boolean]$ExpectedResult
549
+ )
550
+ Test-DotnetPackageDependenciesOnelineBase `
551
+ -ExpectedVersion $ExpectedVersion `
552
+ -ActualVersion $ActualVersion `
553
+ -ConfigDepPackageName "dep.dotnet" `
554
+ -ActualDepPackageName "dep.dotnet" `
555
+ -ExpectedResult $ExpectedResult
556
+ }
532
557
 
533
- $result | Should -BeExactly $true
534
- }
535
-
536
- It 'all package dependencies are up to date with syntax `<PackageReference`>`<`/PackageReference`>' {
537
- $depRepo = "dependent-dotnet"
538
- $repoName = "test-dotnet"
539
- $repoConfigStr = @"
540
- {
541
- "version": "4.3.0",
542
- "packageName": "test.dotnet",
543
- "dependencies": [
544
- "$depRepo"
545
- ]
558
+ function Test-DotnetPackageDependenciesOnelineRegex {
559
+ param (
560
+ [string]$ExpectedVersion,
561
+ [string]$ActualVersion,
562
+ [boolean]$ExpectedResult
563
+ )
564
+ Test-DotnetPackageDependenciesOnelineBase `
565
+ -ExpectedVersion $ExpectedVersion `
566
+ -ActualVersion $ActualVersion `
567
+ -ConfigDepPackageName "dep.(dotnet|SomethingElse)" `
568
+ -ActualDepPackageName "dep.dotnet" `
569
+ -ExpectedResult $ExpectedResult
546
570
  }
547
- "@
548
- $repoConfig = $repoConfigStr | ConvertFrom-Json
549
- $reposStr = @"
550
- {
551
- "$repoName": $repoConfigStr,
552
- "$depRepo": {
571
+
572
+ function Test-DotnetPackageDependenciesMultilinesBase {
573
+ param (
574
+ [string]$ExpectedVersion,
575
+ [string]$ActualVersion,
576
+ [string]$ConfigDepPackageName,
577
+ [string]$ActualDepPackageName,
578
+ [boolean]$ExpectedResult
579
+ )
580
+ $depRepo = "dependent-dotnet"
581
+ $repoName = "test-dotnet"
582
+ $repoConfigStr = @"
583
+ {
553
584
  "version": "4.3.0",
554
- "packageName": "dep.dotnet"
585
+ "packageName": "test.dotnet",
586
+ "dependencies": [
587
+ "$depRepo"
588
+ ]
555
589
  }
556
- }
557
590
  "@
558
- $repos = $reposStr | ConvertFrom-Json
559
-
560
- Mock Test-Path { return $true } `
561
- -ModuleName ReleaseVerifier
562
- Mock Get-ChildItem { return @($('{ "FullName": "file1" }' | ConvertFrom-Json)) } `
563
- -ModuleName ReleaseVerifier
564
- Mock Get-Content { return "<PackageReference Include=`"dep.dotnet`">`r`n<Version>4.030</Version>`r`n</PackageReference>" } `
565
- -ModuleName ReleaseVerifier
591
+ $repoConfig = $repoConfigStr | ConvertFrom-Json
592
+ $reposStr = @"
593
+ {
594
+ "$repoName": $repoConfigStr,
595
+ "$depRepo": {
596
+ "version": "$ExpectedVersion",
597
+ "packageName": "$ConfigDepPackageName"
598
+ }
599
+ }
600
+ "@
601
+ $repos = $reposStr | ConvertFrom-Json
602
+
603
+ Mock Test-Path { return $true } `
604
+ -ModuleName ReleaseVerifier
605
+ Mock Get-ChildItem { return @($('{ "FullName": "file1.csproj" }' | ConvertFrom-Json)) } `
606
+ -ModuleName ReleaseVerifier
607
+ Mock Get-Content { return "<PackageReference Include=`"$ActualDepPackageName`">`r`n<Version>$ActualVersion</Version>`r`n</PackageReference>" } `
608
+ -ModuleName ReleaseVerifier
609
+
610
+ $result = Test-DotnetPackageDependencies `
611
+ -RepositoryName $repoName `
612
+ -RepositoryConfig $repoConfig `
613
+ -Repositories $repos
614
+
615
+ $result | Should -BeExactly $ExpectedResult
616
+ }
566
617
 
567
- $result = Test-DotnetPackageDependencies `
568
- -RepositoryName $repoName `
569
- -RepositoryConfig $repoConfig `
570
- -Repositories $repos
618
+ function Test-DotnetPackageDependenciesMultilines {
619
+ param (
620
+ [string]$ExpectedVersion,
621
+ [string]$ActualVersion,
622
+ [boolean]$ExpectedResult
623
+ )
624
+ Test-DotnetPackageDependenciesMultilinesBase `
625
+ -ExpectedVersion $ExpectedVersion `
626
+ -ActualVersion $ActualVersion `
627
+ -ConfigDepPackageName "dep.dotnet" `
628
+ -ActualDepPackageName "dep.dotnet" `
629
+ -ExpectedResult $ExpectedResult
630
+ }
571
631
 
572
- $result | Should -BeExactly $true
573
- }
574
-
575
- It 'a package dependency is not up to date' {
576
- $depRepo = "dependent-dotnet"
577
- $repoName = "test-dotnet"
578
- $repoConfigStr = @"
579
- {
580
- "version": "4.3.0",
581
- "packageName": "test.dotnet",
582
- "dependencies": [
583
- "$depRepo"
584
- ]
632
+ function Test-DotnetPackageDependenciesMultilinesRegex {
633
+ param (
634
+ [string]$ExpectedVersion,
635
+ [string]$ActualVersion,
636
+ [boolean]$ExpectedResult
637
+ )
638
+ Test-DotnetPackageDependenciesMultilinesBase `
639
+ -ExpectedVersion $ExpectedVersion `
640
+ -ActualVersion $ActualVersion `
641
+ -ConfigDepPackageName "dep.(dotnet|SomethingElse)" `
642
+ -ActualDepPackageName "dep.dotnet" `
643
+ -ExpectedResult $ExpectedResult
585
644
  }
586
- "@
587
- $repoConfig = $repoConfigStr | ConvertFrom-Json
588
- $reposStr = @"
589
- {
590
- "$repoName": $repoConfigStr,
591
- "$depRepo": {
645
+
646
+ function Test-DotnetPackageDependenciesNetFrameworkProjectBase {
647
+ param (
648
+ [string]$ExpectedVersion,
649
+ [string]$ActualVersion,
650
+ [string]$ConfigDepPackageName,
651
+ [string]$ActualDepPackageName,
652
+ [boolean]$ExpectedResult
653
+ )
654
+ $depRepo = "dependent-dotnet"
655
+ $repoName = "test-dotnet"
656
+ $repoConfigStr = @"
657
+ {
592
658
  "version": "4.3.0",
593
- "packageName": "dep.dotnet"
659
+ "packageName": "test.dotnet",
660
+ "dependencies": [
661
+ "$depRepo"
662
+ ]
594
663
  }
595
- }
596
664
  "@
597
- $repos = $reposStr | ConvertFrom-Json
665
+ $repoConfig = $repoConfigStr | ConvertFrom-Json
666
+ $reposStr = @"
667
+ {
668
+ "$repoName": $repoConfigStr,
669
+ "$depRepo": {
670
+ "version": "$ExpectedVersion",
671
+ "packageName": "$ConfigDepPackageName"
672
+ }
673
+ }
674
+ "@
675
+ $repos = $reposStr | ConvertFrom-Json
676
+
677
+ Mock Test-Path { return $true } `
678
+ -ModuleName ReleaseVerifier
679
+ Mock Get-ChildItem { return @($('{ "FullName": "file1.csproj" }' | ConvertFrom-Json)) } `
680
+ -ModuleName ReleaseVerifier
681
+ Mock Get-Content { return "<HintPath>..\..\..\..\..\packages\$($ActualDepPackageName).test.$($ActualVersion)\lib\netstandard2.0\dep.dotnet.test.dll</HintPath>" } `
682
+ -ModuleName ReleaseVerifier
683
+
684
+ $result = Test-DotnetPackageDependencies `
685
+ -RepositoryName $repoName `
686
+ -RepositoryConfig $repoConfig `
687
+ -Repositories $repos
688
+
689
+ $result | Should -BeExactly $ExpectedResult
690
+ }
598
691
 
599
- Mock Test-Path { return $true } `
600
- -ModuleName ReleaseVerifier
601
- Mock Get-ChildItem { return @($('{ "FullName": "file1" }' | ConvertFrom-Json)) } `
602
- -ModuleName ReleaseVerifier
603
- Mock Get-Content { return '<PackageReference Include="dep.dotnet" Version="4.2.9" />' } `
604
- -ModuleName ReleaseVerifier
692
+ function Test-DotnetPackageDependenciesNetFrameworkProject {
693
+ param (
694
+ [string]$ExpectedVersion,
695
+ [string]$ActualVersion,
696
+ [boolean]$ExpectedResult
697
+ )
698
+ Test-DotnetPackageDependenciesNetFrameworkProjectBase `
699
+ -ExpectedVersion $ExpectedVersion `
700
+ -ActualVersion $ActualVersion `
701
+ -ConfigDepPackageName "dep.dotnet" `
702
+ -ActualDepPackageName "dep.dotnet" `
703
+ -ExpectedResult $ExpectedResult
704
+ }
605
705
 
606
- $result = Test-DotnetPackageDependencies `
607
- -RepositoryName $repoName `
608
- -RepositoryConfig $repoConfig `
609
- -Repositories $repos
706
+ function Test-DotnetPackageDependenciesNetFrameworkProjectRegex {
707
+ param (
708
+ [string]$ExpectedVersion,
709
+ [string]$ActualVersion,
710
+ [boolean]$ExpectedResult
711
+ )
712
+ Test-DotnetPackageDependenciesNetFrameworkProjectBase `
713
+ -ExpectedVersion $ExpectedVersion `
714
+ -ActualVersion $ActualVersion `
715
+ -ConfigDepPackageName "dep.(dotnet|SomethingElse)" `
716
+ -ActualDepPackageName "dep.dotnet" `
717
+ -ExpectedResult $ExpectedResult
718
+ }
610
719
 
611
- $result | Should -BeExactly $false
720
+ function Test-DotnetPackageDependenciesPackagesConfigBase {
721
+ param (
722
+ [string]$ExpectedVersion,
723
+ [string]$ActualVersion,
724
+ [string]$ConfigDepPackageName,
725
+ [string]$ActualDepPackageName,
726
+ [boolean]$ExpectedResult
727
+ )
728
+ $depRepo = "dependent-dotnet"
729
+ $repoName = "test-dotnet"
730
+ $repoConfigStr = @"
731
+ {
732
+ "version": "4.3.0",
733
+ "packageName": "test.dotnet",
734
+ "dependencies": [
735
+ "$depRepo"
736
+ ]
737
+ }
738
+ "@
739
+ $repoConfig = $repoConfigStr | ConvertFrom-Json
740
+ $reposStr = @"
741
+ {
742
+ "$repoName": $repoConfigStr,
743
+ "$depRepo": {
744
+ "version": "$ExpectedVersion",
745
+ "packageName": "$ConfigDepPackageName"
746
+ }
747
+ }
748
+ "@
749
+ $repos = $reposStr | ConvertFrom-Json
750
+
751
+ Mock Test-Path { return $true } `
752
+ -ModuleName ReleaseVerifier
753
+ Mock Get-ChildItem { return @($('{ "FullName": "packages.config" }' | ConvertFrom-Json)) } `
754
+ -ModuleName ReleaseVerifier
755
+ Mock Get-Content { return "<package id=`"$($ActualDepPackageName).test`" version=`"$ActualVersion`" targetFramework=`"net472`" />" } `
756
+ -ModuleName ReleaseVerifier
757
+
758
+ $result = Test-DotnetPackageDependencies `
759
+ -RepositoryName $repoName `
760
+ -RepositoryConfig $repoConfig `
761
+ -Repositories $repos
762
+
763
+ $result | Should -BeExactly $ExpectedResult
764
+ }
765
+
766
+ function Test-DotnetPackageDependenciesPackagesConfig {
767
+ param (
768
+ [string]$ExpectedVersion,
769
+ [string]$ActualVersion,
770
+ [boolean]$ExpectedResult
771
+ )
772
+ Test-DotnetPackageDependenciesPackagesConfigBase `
773
+ -ExpectedVersion $ExpectedVersion `
774
+ -ActualVersion $ActualVersion `
775
+ -ConfigDepPackageName "dep.dotnet" `
776
+ -ActualDepPackageName "dep.dotnet" `
777
+ -ExpectedResult $ExpectedResult
778
+ }
779
+
780
+ function Test-DotnetPackageDependenciesPackagesConfigRegex {
781
+ param (
782
+ [string]$ExpectedVersion,
783
+ [string]$ActualVersion,
784
+ [boolean]$ExpectedResult
785
+ )
786
+ Test-DotnetPackageDependenciesPackagesConfigBase `
787
+ -ExpectedVersion $ExpectedVersion `
788
+ -ActualVersion $ActualVersion `
789
+ -ConfigDepPackageName "dep.(dotnet|SomethingElse)" `
790
+ -ActualDepPackageName "dep.dotnet" `
791
+ -ExpectedResult $ExpectedResult
792
+ }
793
+ }
794
+
795
+ It 'all package dependencies are up to date with syntax `<PackageReference `/`>' {
796
+ Test-DotnetPackageDependenciesOneline -ExpectedVersion "4.3.0" -ActualVersion "4.3.0" -ExpectedResult $true
797
+ }
798
+
799
+ It 'all package dependencies are up to date with syntax `<PackageReference `/`> with regex' {
800
+ Test-DotnetPackageDependenciesOnelineRegex -ExpectedVersion "4.3.0" -ActualVersion "4.3.0" -ExpectedResult $true
801
+ }
802
+
803
+ It 'a package dependency is not up to date with syntax `<PackageReference `/`>' {
804
+ Test-DotnetPackageDependenciesOneline -ExpectedVersion "4.3.0" -ActualVersion "4.2.9" -ExpectedResult $false
805
+ }
806
+
807
+ It 'a package dependency is not up to date with syntax `<PackageReference `/`> with regex' {
808
+ Test-DotnetPackageDependenciesOnelineRegex -ExpectedVersion "4.3.0" -ActualVersion "4.2.9" -ExpectedResult $false
809
+ }
810
+
811
+ It 'all package dependencies are up to date with syntax `<PackageReference`>`<`/PackageReference`>' {
812
+ Test-DotnetPackageDependenciesMultilines -ExpectedVersion "4.3.0" -ActualVersion "4.3.0" -ExpectedResult $true
813
+ }
814
+
815
+ It 'all package dependencies are up to date with syntax `<PackageReference`>`<`/PackageReference`> with regex' {
816
+ Test-DotnetPackageDependenciesMultilinesRegex -ExpectedVersion "4.3.0" -ActualVersion "4.3.0" -ExpectedResult $true
817
+ }
818
+
819
+ It 'a package dependency is not up to date with syntax `<PackageReference`>`<`/PackageReference`>' {
820
+ Test-DotnetPackageDependenciesMultilines -ExpectedVersion "4.3.0" -ActualVersion "4.2.9" -ExpectedResult $false
821
+ }
822
+
823
+ It 'a package dependency is not up to date with syntax `<PackageReference`>`<`/PackageReference`> with regex' {
824
+ Test-DotnetPackageDependenciesMultilinesRegex -ExpectedVersion "4.3.0" -ActualVersion "4.2.9" -ExpectedResult $false
825
+ }
826
+
827
+ It 'all package dependencies are up to date with dotnet framework .csproj syntax' {
828
+ Test-DotnetPackageDependenciesNetFrameworkProject -ExpectedVersion "4.3.0" -ActualVersion "4.3.0" -ExpectedResult $true
829
+ }
830
+
831
+ It 'all package dependencies are up to date with dotnet framework .csproj syntax with regex' {
832
+ Test-DotnetPackageDependenciesNetFrameworkProjectRegex -ExpectedVersion "4.3.0" -ActualVersion "4.3.0" -ExpectedResult $true
833
+ }
834
+
835
+ It 'a package dependency is not up to date with dotnet framework .csproj syntax' {
836
+ Test-DotnetPackageDependenciesNetFrameworkProject -ExpectedVersion "4.3.0" -ActualVersion "4.2.9" -ExpectedResult $false
837
+ }
838
+
839
+ It 'a package dependency is not up to date with dotnet framework .csproj syntax with regex' {
840
+ Test-DotnetPackageDependenciesNetFrameworkProjectRegex -ExpectedVersion "4.3.0" -ActualVersion "4.2.9" -ExpectedResult $false
841
+ }
842
+
843
+ It 'all package dependencies are up to date with packages.config file' {
844
+ Test-DotnetPackageDependenciesPackagesConfig -ExpectedVersion "4.3.0" -ActualVersion "4.3.0" -ExpectedResult $true
845
+ }
846
+
847
+ It 'all package dependencies are up to date with packages.config file with regex' {
848
+ Test-DotnetPackageDependenciesPackagesConfigRegex -ExpectedVersion "4.3.0" -ActualVersion "4.3.0" -ExpectedResult $true
849
+ }
850
+
851
+ It 'a package dependency is not up to date with packages.config file' {
852
+ Test-DotnetPackageDependenciesPackagesConfig -ExpectedVersion "4.3.0" -ActualVersion "4.2.9" -ExpectedResult $false
853
+ }
854
+
855
+ It 'a package dependency is not up to date with packages.config file with regex' {
856
+ Test-DotnetPackageDependenciesPackagesConfigRegex -ExpectedVersion "4.3.0" -ActualVersion "4.2.9" -ExpectedResult $false
612
857
  }
613
858
  }
614
859
 
@@ -116,7 +116,8 @@ function Test-DotnetPackageDependencies {
116
116
  foreach ($dependency in $dependencies) {
117
117
  $packageName = $Repositories."$dependency".packageName
118
118
  if ([string]::IsNullOrEmpty($packageName)) { continue }
119
- # This pattern has a match group name 'name'. That will be used to preserv the actual matched package name.
119
+
120
+ # This pattern has a match group name 'name'. That will be used to preserve the actual matched package name.
120
121
  $matchPattern = "\<PackageReference \s*Include=\`"(?<name>$packageName.*)\`" \s*Version=\`"(?<version>\d+\.\d+\.\d+)\`"\s*/\>"
121
122
  if ($projFileContent -match "$matchPattern") {
122
123
  Write-Host "# Version variable matches dependency $packageName."
@@ -127,7 +128,7 @@ function Test-DotnetPackageDependencies {
127
128
  }
128
129
  }
129
130
 
130
- # This pattern has a match group name 'name'. That will be used to preserv the actual matched package name.
131
+ # This pattern has a match group name 'name'. That will be used to preserve the actual matched package name.
131
132
  $matchPattern = "(?<prefix>\<PackageReference \s*Include=\`"$packageName.*\`"\s*\>.*\r\n.*\<Version\>)(?<version>\d+\.\d+\.\d+)(?<suffix>\</Version\>.*\r\n.*\</PackageReference\>)"
132
133
  if ($projFileContent -match "$matchPattern") {
133
134
  Write-Host "# Version variable matches dependency $packageName."
@@ -137,6 +138,39 @@ function Test-DotnetPackageDependencies {
137
138
  return $false
138
139
  }
139
140
  }
141
+
142
+ # This pattern has a match group name 'name'. That will be used to preserve the actual matched package name.
143
+ $matchPattern = "(?<prefix>\<HintPath\>\s*.*$packageName.*)(?<version>\d+\.\d+\.\d+)(?<suffix>\\lib.*\<\/HintPath\>)"
144
+ if ($projFileContent -match "$matchPattern") {
145
+ Write-Host "# Version variable matches dependency $packageName."
146
+ $dependencyVersion = $Repositories."$dependency".version
147
+ if ($Matches['version'] -ne $dependencyVersion) {
148
+ Write-Host "# FAIL: Version '$($Matches['version'])' of $dependency does not match $dependencyVersion"
149
+ return $false
150
+ }
151
+ }
152
+ }
153
+ }
154
+
155
+ # Test each packages.config file.
156
+ foreach ($project in $(Get-ChildItem -Filter packages.config -Recurse)) {
157
+ Write-Host "# Working on project $project"
158
+ $projFileContent = $(Get-Content $project.FullName -Raw)
159
+ # Test each packages.config file with dependency versions.
160
+ foreach ($dependency in $dependencies) {
161
+ $packageName = $Repositories."$dependency".packageName
162
+ if ([string]::IsNullOrEmpty($packageName)) { continue }
163
+ # This pattern has a match group name 'name'. That will be used to preserve the actual matched package name.
164
+ $matchPattern = "\<PackageReference \s*Include=\`"(?<name>$packageName.*)\`" \s*Version=\`"(?<version>\d+\.\d+\.\d+)\`"\s*/\>"
165
+ $matchPattern = "(?<prefix>\<package \s*id=\`"$packageName.*\`" \s*version=\`")(?<version>\d+\.\d+\.\d+)(?<suffix>\`"\s*targetFramework=\`".*\`"\s*/\>)"
166
+ if ($projFileContent -match "$matchPattern") {
167
+ Write-Host "# Version variable matches dependency $packageName."
168
+ $dependencyVersion = $Repositories."$dependency".version
169
+ if ($Matches['version'] -ne $dependencyVersion) {
170
+ Write-Host "# FAIL: Version '$($Matches['version'])' of $dependency does not match $dependencyVersion"
171
+ return $false
172
+ }
173
+ }
140
174
  }
141
175
  }
142
176
  } else {
@@ -135,5 +135,5 @@ function Get-ReviewerId {
135
135
  }
136
136
 
137
137
  # When using this script locally uncomment and update the below environment accordingly.
138
- $env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI = "https://51degrees.visualstudio.com/DefaultCollection/"
139
- $env:SYSTEM_TEAMPROJECTID = "APIs%20Release%20Test%20Environment"
138
+ # $env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI = "https://51degrees.visualstudio.com/DefaultCollection/"
139
+ # $env:SYSTEM_TEAMPROJECTID = "APIs%20Release%20Test%20Environment"