@@ -33,7 +33,6 @@ import (
33
33
"github.com/jfrog/jfrog-cli-core/v2/artifactory/utils"
34
34
commonCliUtils "github.com/jfrog/jfrog-cli-core/v2/common/cliutils"
35
35
"github.com/jfrog/jfrog-cli-core/v2/common/commands"
36
- "github.com/jfrog/jfrog-cli-core/v2/common/project"
37
36
"github.com/jfrog/jfrog-cli-core/v2/common/spec"
38
37
commontests "github.com/jfrog/jfrog-cli-core/v2/common/tests"
39
38
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
@@ -5652,82 +5651,6 @@ func readerGetErrorAndAssert(t *testing.T, reader *content.ContentReader) {
5652
5651
assert .NoError (t , reader .GetError (), "Couldn't get reader error" )
5653
5652
}
5654
5653
5655
- func TestProjectInitMaven (t * testing.T ) {
5656
- testProjectInit (t , "multiproject" , coreutils .Maven )
5657
- }
5658
-
5659
- func TestProjectInitGradle (t * testing.T ) {
5660
- testProjectInit (t , "gradleproject" , coreutils .Gradle )
5661
- }
5662
-
5663
- func TestProjectInitNpm (t * testing.T ) {
5664
- testProjectInit (t , "npmproject" , coreutils .Npm )
5665
- }
5666
-
5667
- func TestProjectInitGo (t * testing.T ) {
5668
- testProjectInit (t , "dependency" , coreutils .Go )
5669
- }
5670
-
5671
- func TestProjectInitPip (t * testing.T ) {
5672
- testProjectInit (t , "requirementsproject" , coreutils .Pip )
5673
- }
5674
-
5675
- func TestProjectInitNuget (t * testing.T ) {
5676
- testProjectInit (t , "multipackagesconfig" , coreutils .Nuget )
5677
- }
5678
-
5679
- func testProjectInit (t * testing.T , projectExampleName string , technology coreutils.Technology ) {
5680
- initArtifactoryTest (t , "" )
5681
- defer cleanArtifactoryTest ()
5682
- // Create temp JFrog home dir
5683
- tmpHomeDir , deleteHomeDir := coretests .CreateTempDirWithCallbackAndAssert (t )
5684
- defer deleteHomeDir ()
5685
- clientTestUtils .SetEnvAndAssert (t , coreutils .HomeDir , tmpHomeDir )
5686
- _ , err := createServerConfigAndReturnPassphrase (t )
5687
- assert .NoError (t , err )
5688
-
5689
- // Copy a simple project in a temp work dir
5690
- tmpWorkDir , deleteWorkDir := coretests .CreateTempDirWithCallbackAndAssert (t )
5691
- defer deleteWorkDir ()
5692
- testdataSrc := filepath .Join (filepath .FromSlash (tests .GetTestResourcesPath ()), technology .String (), projectExampleName )
5693
- err = biutils .CopyDir (testdataSrc , tmpWorkDir , true , nil )
5694
- assert .NoError (t , err )
5695
- if technology == coreutils .Go {
5696
- goModeOriginalPath := filepath .Join (tmpWorkDir , "createGoProject_go.mod_suffix" )
5697
- goModeTargetPath := filepath .Join (tmpWorkDir , "go.mod" )
5698
- assert .NoError (t , os .Rename (goModeOriginalPath , goModeTargetPath ))
5699
- }
5700
-
5701
- // Run cd command to temp dir.
5702
- currentWd , err := os .Getwd ()
5703
- assert .NoError (t , err )
5704
- changeDirBack := clientTestUtils .ChangeDirWithCallback (t , currentWd , tmpWorkDir )
5705
- defer changeDirBack ()
5706
- // Run JFrog project init
5707
- err = platformCli .WithoutCredentials ().Exec ("project" , "init" , "--path" , tmpWorkDir , "--server-id=" + tests .ServerId )
5708
- assert .NoError (t , err )
5709
- // Validate correctness of .jfrog/projects/$technology.yml
5710
- validateProjectYamlFile (t , tmpWorkDir , technology .String ())
5711
- // Validate correctness of .jfrog/projects/build.yml
5712
- validateBuildYamlFile (t , tmpWorkDir )
5713
- }
5714
-
5715
- func validateProjectYamlFile (t * testing.T , projectDir , technology string ) {
5716
- techConfig , err := project .ReadConfigFile (filepath .Join (projectDir , ".jfrog" , "projects" , technology + ".yaml" ), project .YAML )
5717
- if assert .NoError (t , err ) {
5718
- assert .Equal (t , technology , techConfig .GetString ("type" ))
5719
- assert .Equal (t , tests .ServerId , techConfig .GetString ("resolver.serverId" ))
5720
- assert .Equal (t , tests .ServerId , techConfig .GetString ("deployer.serverId" ))
5721
- }
5722
- }
5723
-
5724
- func validateBuildYamlFile (t * testing.T , projectDir string ) {
5725
- techConfig , err := project .ReadConfigFile (filepath .Join (projectDir , ".jfrog" , "projects" , "build.yaml" ), project .YAML )
5726
- assert .NoError (t , err )
5727
- assert .Equal (t , "build" , techConfig .GetString ("type" ))
5728
- assert .Equal (t , filepath .Base (projectDir + "/" ), techConfig .GetString ("name" ))
5729
- }
5730
-
5731
5654
func TestTerraformPublish (t * testing.T ) {
5732
5655
testTerraformPublish (t , false )
5733
5656
}
0 commit comments