github.com/redhat-appstudio/e2e-tests@v0.0.0-20240520140907-9709f6f59323/tests/rhtap-demo/config/scenarios.go (about)

     1  package config
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/redhat-appstudio/e2e-tests/pkg/constants"
     7  	"github.com/redhat-appstudio/e2e-tests/pkg/utils"
     8  )
     9  
    10  // All multiple components scenarios are supported in the next jira: https://issues.redhat.com/browse/DEVHAS-305
    11  const (
    12  	MultiComponentWithoutDockerFileAndDevfile     = "multi-component scenario with components without devfile or dockerfile"
    13  	MultiComponentWithAllSupportedImportScenarios = "multi-component scenario with all supported import components"
    14  	MultiComponentWithDevfileAndDockerfile        = "multi-component scenario with components with devfile or dockerfile or both"
    15  	MultiComponentWithUnsupportedRuntime          = "multi-component scenario with a component with a supported runtime and another unsuported"
    16  )
    17  
    18  var TestScenarios = []TestSpec{
    19  	{
    20  		Name:            "Maven project - Simple and Advanced build",
    21  		ApplicationName: "rhtap-demo-app",
    22  		Skip:            false,
    23  		Components: []ComponentSpec{
    24  			{
    25  				Name:                       "rhtap-demo-component",
    26  				Language:                   "Java",
    27  				GitSourceUrl:               fmt.Sprintf("https://github.com/%s/%s", utils.GetEnv(constants.GITHUB_E2E_ORGANIZATION_ENV, "redhat-appstudio-qe"), "hacbs-test-project"),
    28  				GitSourceRevision:          "34da5a8f51fba6a8b7ec75a727d3c72ebb5e1274",
    29  				GitSourceContext:           "",
    30  				GitSourceDefaultBranchName: "main",
    31  				HealthEndpoint:             "/",
    32  				SkipDeploymentCheck:        true,
    33  				AdvancedBuildSpec: &AdvancedBuildSpec{
    34  					TestScenario: TestScenarioSpec{
    35  						GitURL:      "https://github.com/konflux-ci/integration-examples.git",
    36  						GitRevision: "843f455fe87a6d7f68c238f95a8f3eb304e65ac5",
    37  						TestPath:    "pipelines/integration_resolver_pipeline_pass.yaml",
    38  					},
    39  				},
    40  			},
    41  		},
    42  	},
    43  	{
    44  		Name:            "DEVHAS-234: creates an application with springboot component from RHTAP samples",
    45  		ApplicationName: "e2e-springboot",
    46  		Components: []ComponentSpec{
    47  			{
    48  				Name:              "springboot-component",
    49  				ContainerSource:   "",
    50  				Language:          "Java",
    51  				GitSourceUrl:      "https://github.com/devfile-samples/devfile-sample-java-springboot-basic",
    52  				GitSourceRevision: "",
    53  				GitSourceContext:  "",
    54  				HealthEndpoint:    "/",
    55  			},
    56  		},
    57  	},
    58  	{
    59  		Name:            "DEVHAS-234: creates an application with python component from RHTAP samples",
    60  		ApplicationName: "e2e-python-personal",
    61  		Components: []ComponentSpec{
    62  			{
    63  				Name:                "component-python-flask",
    64  				ContainerSource:     "",
    65  				Language:            "Python",
    66  				SkipDeploymentCheck: true,
    67  				GitSourceUrl:        "https://github.com/devfile-samples/devfile-sample-python-basic.git",
    68  				GitSourceRevision:   "",
    69  				GitSourceContext:    "",
    70  				HealthEndpoint:      "/",
    71  			},
    72  		},
    73  	},
    74  	{
    75  		Name:            "DEVHAS-234: creates an application with dotnet component from RHTAP samples",
    76  		ApplicationName: "e2e-dotnet",
    77  		// https://redhat-appstudio.github.io/docs.appstudio.io/Documentation/main/getting-started/get-started/#choosing-a-bundled-sample
    78  		// Seems like RHTAP dont support yet a dotnet sample. Disabling for not this tests.
    79  		Skip: true,
    80  		Components: []ComponentSpec{
    81  			{
    82  				Name:              "dotnet-component",
    83  				ContainerSource:   "",
    84  				Language:          "dotNet",
    85  				GitSourceUrl:      "https://github.com/devfile-samples/devfile-sample-dotnet60-basic",
    86  				GitSourceRevision: "",
    87  				GitSourceContext:  "",
    88  				HealthEndpoint:    "/",
    89  			},
    90  		},
    91  	},
    92  	{
    93  		Name:            "DEVHAS-234: create an nodejs application without dockerfile",
    94  		ApplicationName: "e2e-nodejs",
    95  		Components: []ComponentSpec{
    96  			{
    97  				Name:              "nodejs-no-dockerfile",
    98  				ContainerSource:   "",
    99  				Language:          "JavaScript",
   100  				GitSourceUrl:      "https://github.com/nodeshift-starters/nodejs-health-check.git",
   101  				GitSourceRevision: "",
   102  				GitSourceContext:  "",
   103  				HealthEndpoint:    "/live",
   104  			},
   105  			{
   106  				Name:              "nodejs-priv",
   107  				Private:           true,
   108  				ContainerSource:   "",
   109  				Language:          "JavaScript",
   110  				GitSourceUrl:      "https://github.com/redhat-appstudio-qe-bot/nodejs-health-check.git",
   111  				GitSourceRevision: "",
   112  				GitSourceContext:  "",
   113  				HealthEndpoint:    "/live",
   114  			},
   115  		},
   116  	},
   117  	{
   118  		Name:            "DEVHAS-234: create an golang application",
   119  		ApplicationName: "e2e-golang",
   120  		Components: []ComponentSpec{
   121  			{
   122  				Name:              "golang-dockerfile",
   123  				ContainerSource:   "",
   124  				Language:          "Go",
   125  				GitSourceUrl:      "https://github.com/devfile-samples/devfile-sample-go-basic",
   126  				GitSourceRevision: "",
   127  				GitSourceContext:  "",
   128  				HealthEndpoint:    "/",
   129  			},
   130  		},
   131  	},
   132  	{
   133  		Name:            "DEVHAS-234: create an nodejs application with dockerfile and devfile",
   134  		ApplicationName: "e2e-nodejs",
   135  		Components: []ComponentSpec{
   136  			{
   137  				Name:              "nodejs-dockerfile",
   138  				ContainerSource:   "",
   139  				Language:          "JavaScript",
   140  				GitSourceUrl:      "https://github.com/nodeshift-starters/devfile-sample",
   141  				GitSourceRevision: "",
   142  				GitSourceContext:  "",
   143  				HealthEndpoint:    "/",
   144  			},
   145  		},
   146  	},
   147  	{
   148  		Name:            "DEVHAS-234: create an application with quarkus component",
   149  		ApplicationName: "quarkus",
   150  		Components: []ComponentSpec{
   151  			{
   152  				Name:              "quarkus-devfile",
   153  				ContainerSource:   "",
   154  				Language:          "Java",
   155  				GitSourceUrl:      "https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git",
   156  				GitSourceRevision: "",
   157  				GitSourceContext:  "",
   158  				HealthEndpoint:    "/hello-resteasy",
   159  			},
   160  		},
   161  	},
   162  	{
   163  		Name:            "DEVHAS-234: create an application with branch and context dir",
   164  		ApplicationName: "e2e-java",
   165  		Components: []ComponentSpec{
   166  			{
   167  				Name:              "component-devfile-java-sample",
   168  				ContainerSource:   "",
   169  				Language:          "Java",
   170  				GitSourceUrl:      "https://github.com/redhat-appstudio-qe/java-sample",
   171  				GitSourceRevision: "testing",
   172  				GitSourceContext:  "java/java",
   173  				HealthEndpoint:    "/",
   174  			},
   175  		},
   176  	},
   177  	{
   178  		Name:            "DEVHAS-234: creates quarkus application(with dockerfile but not devfile) which is not included in AppStudio starter stack",
   179  		ApplicationName: "status-quarkus-io",
   180  		Components: []ComponentSpec{
   181  			{
   182  				Name:                "status-quarkus-io",
   183  				ContainerSource:     "",
   184  				Language:            "Java",
   185  				GitSourceUrl:        "https://github.com/quarkusio/status.quarkus.io.git",
   186  				GitSourceRevision:   "",
   187  				GitSourceContext:    "",
   188  				HealthEndpoint:      "/",
   189  				SkipDeploymentCheck: true,
   190  			},
   191  		},
   192  	},
   193  	{
   194  		Name:            "DEVHAS-234: creates nodejs application(without dockerfile and devfile) which is not included in AppStudio starter stack",
   195  		ApplicationName: "nodejs-users",
   196  		Components: []ComponentSpec{
   197  			{
   198  				Name:              "nodejs-user",
   199  				ContainerSource:   "",
   200  				Language:          "JavaScript",
   201  				GitSourceUrl:      "https://github.com/redhat-appstudio-qe/simple-nodejs-app.git",
   202  				GitSourceRevision: "",
   203  				GitSourceContext:  "",
   204  				HealthEndpoint:    "/users",
   205  			},
   206  		},
   207  	},
   208  	{
   209  		Name:            "DEVHAS-337: creates quarkus application from a private repository which contain a devfile",
   210  		ApplicationName: "private-devfile",
   211  		Components: []ComponentSpec{
   212  			{
   213  				Private:           true,
   214  				Name:              "quarkus-devfile",
   215  				ContainerSource:   "",
   216  				Language:          "Java",
   217  				GitSourceUrl:      "https://github.com/redhat-appstudio-qe/private-quarkus-devfile-sample.git",
   218  				GitSourceRevision: "",
   219  				GitSourceContext:  "",
   220  				HealthEndpoint:    "/hello-resteasy",
   221  			},
   222  		},
   223  	},
   224  	{
   225  		Name:            "DEVHAS-337: creates golang application from a private repository which contain a devfile referencing a private Dockerfile URI",
   226  		ApplicationName: "private-devfile",
   227  		// Due to bug in build team fetching private stuffs lets skip this test:
   228  		// Bug: https://issues.redhat.com/browse/RHTAPBUGS-912
   229  		Skip: true,
   230  		Components: []ComponentSpec{
   231  			{
   232  				Private:        true,
   233  				Name:           "go-devfile-private",
   234  				Language:       "Go",
   235  				GitSourceUrl:   "https://github.com/redhat-appstudio-qe/devfile-sample-go-basic-private-dockerfile-full-private.git",
   236  				HealthEndpoint: "/",
   237  			},
   238  		},
   239  	},
   240  	{
   241  		Name:            "Private nested application with 2 golang components",
   242  		ApplicationName: "mc-golang-nested",
   243  		Components: []ComponentSpec{
   244  			{
   245  				Name:                "mc-golang-nested",
   246  				SkipDeploymentCheck: true,
   247  				Private:             true,
   248  				GitSourceUrl:        "https://github.com/redhat-appstudio-qe/devfile-sample-go-basic-private-devfile-nested.git",
   249  			},
   250  		},
   251  	},
   252  	{
   253  		Name:            "Application with a golang component with dockerfile but not devfile (private)",
   254  		ApplicationName: "mc-golang-nested",
   255  		Components: []ComponentSpec{
   256  			{
   257  				Name:                "mc-golang-nodevfile",
   258  				SkipDeploymentCheck: true,
   259  				Private:             true,
   260  				GitSourceUrl:        "https://github.com/redhat-appstudio-qe/devfile-sample-go-basic-dockerfile-only-private.git",
   261  			},
   262  		},
   263  	},
   264  	{
   265  		Name:            "Private component withoud devfile/docker",
   266  		ApplicationName: "mc-golang-without",
   267  		Components: []ComponentSpec{
   268  			{
   269  				Name:                "mc-golang-without",
   270  				SkipDeploymentCheck: true,
   271  				Private:             true,
   272  				GitSourceUrl:        "https://github.com/redhat-appstudio-qe/devfile-sample-go-basic-dockerfile-empty-private.git",
   273  			},
   274  		},
   275  	},
   276  	{
   277  		Name:            MultiComponentWithDevfileAndDockerfile,
   278  		ApplicationName: "mc-two-scenarios",
   279  		Components: []ComponentSpec{
   280  			{
   281  				Name:         "mc-two-scenarios",
   282  				GitSourceUrl: "https://github.com/redhat-appstudio-qe/rhtap-devfile-multi-component.git",
   283  			},
   284  		},
   285  	},
   286  	{
   287  		Name:            MultiComponentWithAllSupportedImportScenarios,
   288  		ApplicationName: "mc-three-scenarios",
   289  		Components: []ComponentSpec{
   290  			{
   291  				Name:         "mc-three-scenarios",
   292  				GitSourceUrl: "https://github.com/redhat-appstudio-qe/rhtap-three-component-scenarios.git",
   293  			},
   294  		},
   295  	},
   296  	{
   297  		Name:            MultiComponentWithUnsupportedRuntime,
   298  		ApplicationName: "mc-unsupported-runtime",
   299  		Components: []ComponentSpec{
   300  			{
   301  				Name:         "mc-unsuported-runtime",
   302  				GitSourceUrl: "https://github.com/redhat-appstudio-qe/rhtap-mc-unsuported-runtime.git",
   303  			},
   304  		},
   305  	},
   306  	{
   307  		Name:            "Stage Test - Simple Stage Test With SpringBoot Basic",
   308  		ApplicationName: "rhtap-stage-demo-app",
   309  		Skip:            false,
   310  		Stage:           true,
   311  		Components: []ComponentSpec{
   312  			{
   313  				Name:                "rhtap-stage-demo-component",
   314  				ContainerSource:     "",
   315  				Language:            "Java",
   316  				GitSourceUrl:        "https://github.com/devfile-samples/devfile-sample-java-springboot-basic",
   317  				GitSourceRevision:   "",
   318  				GitSourceContext:    "",
   319  				HealthEndpoint:      "/",
   320  				SkipDeploymentCheck: true,
   321  			},
   322  		},
   323  	},
   324  }
   325  
   326  func GetScenarios(isStage bool) []TestSpec {
   327  	var StageScenarios []TestSpec
   328  	var NormalScenarios []TestSpec
   329  
   330  	for _, Scenario := range TestScenarios {
   331  		if Scenario.Stage {
   332  			StageScenarios = append(StageScenarios, Scenario)
   333  		} else {
   334  			NormalScenarios = append(NormalScenarios, Scenario)
   335  		}
   336  	}
   337  
   338  	if isStage {
   339  		return StageScenarios
   340  	} else {
   341  		return NormalScenarios
   342  	}
   343  }