(
context: &Context,
test_domain: &str,
with_router: bool,
with_sticky: bool,
with_ip_whitelist_source_range: Option<String>,
)
| 639 | } |
| 640 | |
| 641 | pub fn environment_only_http_server( |
| 642 | context: &Context, |
| 643 | test_domain: &str, |
| 644 | with_router: bool, |
| 645 | with_sticky: bool, |
| 646 | with_ip_whitelist_source_range: Option<String>, |
| 647 | ) -> EnvironmentRequest { |
| 648 | let router_id = QoveryIdentifier::new_random(); |
| 649 | let router_name = format!("router-{}", router_id.short()); |
| 650 | let suffix = generate_id(); |
| 651 | let application_id = Uuid::new_v4(); |
| 652 | let application_name = format!("{}-{}", "mini-http", &suffix); |
| 653 | let application_domain = format!("{}.{}.{}", application_name, context.cluster_short_id(), test_domain); |
| 654 | let settings = ApplicationAdvancedSettings { |
| 655 | network_ingress_sticky_session_enable: with_sticky, |
| 656 | network_ingress_whitelist_source_range: with_ip_whitelist_source_range.clone().unwrap_or_default(), |
| 657 | network_gateway_api_sticky_session_enable: with_sticky, |
| 658 | network_gateway_api_whitelist_source_range: with_ip_whitelist_source_range.unwrap_or_default(), |
| 659 | ..Default::default() |
| 660 | }; |
| 661 | |
| 662 | let env_id = Uuid::new_v4(); |
| 663 | let mut req = EnvironmentRequest { |
| 664 | execution_id: context.execution_id().to_string(), |
| 665 | long_id: env_id, |
| 666 | name: "env".to_string(), |
| 667 | kube_name: format!("env-{}-my-env", to_short_id(&env_id)), |
| 668 | project_long_id: Uuid::new_v4(), |
| 669 | organization_long_id: Uuid::new_v4(), |
| 670 | action: Action::Create, |
| 671 | max_parallel_build: 1, |
| 672 | max_parallel_deploy: 1, |
| 673 | applications: vec![Application { |
| 674 | long_id: application_id, |
| 675 | name: application_name.clone(), |
| 676 | kube_name: application_name, |
| 677 | /*name: "simple-app".to_string(),*/ |
| 678 | git_url: "https://github.com/Qovery/engine-testing.git".to_string(), |
| 679 | commit_id: "d22414a253db2bcf3acf91f85565d2dabe9211cc".to_string(), |
| 680 | dockerfile_path: Some("Dockerfile".to_string()), |
| 681 | command_args: vec![], |
| 682 | entrypoint: None, |
| 683 | root_path: String::from("/"), |
| 684 | action: Action::Create, |
| 685 | git_credentials: None, |
| 686 | storage: vec![], |
| 687 | environment_vars_with_infos: btreemap! {}, |
| 688 | external_secrets: btreemap![], |
| 689 | mounted_files: vec![], |
| 690 | branch: "main".to_string(), |
| 691 | public_domain: format!("{application_id}.{test_domain}"), |
| 692 | ports: vec![PortIo { |
| 693 | long_id: Default::default(), |
| 694 | port: 80, |
| 695 | is_default: true, |
| 696 | name: "p80".to_string(), |
| 697 | publicly_accessible: true, |
| 698 | protocol: Protocol::HTTP, |
no test coverage detected