From 5cd78c6eebce466a3238466bf2fe7a11ea275293 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Fri, 14 Aug 2026 10:20:04 +0800 Subject: [PATCH] test: move all providers test to separate packages --- .../1panel/1panel_test.go | 6 +- .../aliyun-cas/aliyun_cas_test.go | 6 +- .../aliyun-slb/aliyun_slb_test.go | 6 +- .../aws-acm/aws_acm_test.go | 6 +- .../aws-iam/aws_iam_test.go | 6 +- .../axisnow/axisnow_test.go | 6 +- .../azure-keyvault/azure_keyvault_test.go | 6 +- .../baiducloud-cert/baiducloud_cert_test.go | 6 +- .../baishan-cdn/baishan_cdn_test.go | 6 +- .../byteplus-cdn/byteplus_cdn_test.go | 6 +- .../byteplus_certcenter_test.go | 6 +- .../byteplus_medialive_test.go | 6 +- .../cmcccloud-vlb/cmcccloud_vlb_test.go | 6 +- .../ctcccloud-ao/ctcccloud_ao_test.go | 6 +- .../ctcccloud-cdn/ctcccloud_cdn_test.go | 6 +- .../ctcccloud-cms/ctcccloud_cms_test.go | 6 +- .../ctcccloud-elb/ctcccloud_elb_test.go | 6 +- .../ctcccloud-icdn/ctcccloud_icdn_test.go | 6 +- .../ctcccloud-lvdn/ctcccloud_lvdn_test.go | 6 +- .../digitalocean_certificate_test.go | 6 +- .../dogecloud/dogecloud_test.go | 6 +- .../dokploy/dokploy_test.go | 6 +- .../gcore-cdn/gcore_cdn_test.go | 6 +- .../googlecloud_certificatemanager_test.go | 6 +- .../huaweicloud-elb/huaweicloud_elb_test.go | 6 +- .../huaweicloud-scm/huaweicloud_scm_test.go | 6 +- .../huaweicloud-waf/huaweicloud_waf_test.go | 6 +- .../jdcloud-ssl/jdcloud_ssl_test.go | 6 +- .../ksyun-kcm/ksyun_kcm_test.go | 6 +- .../ksyun-slb/ksyun_slb_test.go | 6 +- .../nginxproxymanager_test.go | 6 +- .../oraclecloud_certificatesmgmt_test.go | 6 +- .../qingcloud-lb/qingcloud_lb_test.go | 6 +- .../qiniu-sslcert/qiniu_sslcert_test.go | 6 +- .../rainyun_sslcenter_test.go | 6 +- .../tencentcloud_gaap_test.go | 6 +- .../tencentcloud-ssl/tencentcloud_ssl_test.go | 6 +- .../tencentcloud-tse/tencentcloud_tse_test.go | 6 +- .../testing.go => providers-tester/tester.go} | 18 ++-- .../certmgr/providers-tester/tester_args.go | 9 ++ .../ucloud-ulb/ucloud_ulb_test.go | 6 +- .../ucloud-upathx/ucloud_upathx_test.go | 6 +- .../ucloud-ussl/ucloud_ussl_test.go | 6 +- .../upyun-ssl/upyun_ssl_test.go | 6 +- .../volcengine-cdn/volcengine_cdn_test.go | 6 +- .../volcengine_certcenter_test.go | 6 +- .../volcengine-live/volcengine_live_test.go | 6 +- .../wangsu_certificate_test.go | 6 +- .../yandexcloud_certificatemanager_test.go | 6 +- .../zenlayer-cdn/zenlayer_cdn_test.go | 6 +- .../zenlayer-ga/zenlayer_ga_test.go | 6 +- pkg/core/certmgr/testing/args.go | 9 -- .../1panel-console/1panel_console_test.go | 6 +- .../1panel/1panel_test.go | 8 +- .../aliyun-alb/aliyun_alb_test.go | 8 +- .../aliyun-apigw/aliyun_apigw_test.go | 6 +- .../aliyun-cdn/aliyun_cdn_test.go | 6 +- .../aliyun-clb/aliyun_clb_test.go | 8 +- .../aliyun-dcdn/aliyun_dcdn_test.go | 6 +- .../aliyun-ddospro/aliyun_ddospro_test.go | 6 +- .../aliyun-esa-saas/aliyun_esasaas_test.go | 6 +- .../aliyun-esa/aliyun_esa_test.go | 6 +- .../aliyun-fc/aliyun_fc_test.go | 6 +- .../aliyun-ga/aliyun_ga_test.go | 8 +- .../aliyun-live/aliyun_live_test.go | 6 +- .../aliyun-nlb/aliyun_nlb_test.go | 8 +- .../aliyun-oss/aliyun_oss_test.go | 6 +- .../aliyun-vod/aliyun_vod_test.go | 6 +- .../aliyun-waf/aliyun_waf_test.go | 6 +- .../apisix/apisix_test.go | 6 +- .../aws-alb/aws_alb_test.go | 6 +- .../aws-amplify/aws_amplify_test.go | 6 +- .../aws-apigateway/aws_apigateway_test.go | 6 +- .../aws-clb/aws_clb_test.go | 6 +- .../aws-cloudfront/aws_cloudfront_test.go | 6 +- .../aws-nlb/aws_nlb_test.go | 6 +- .../baiducloud_appblb_test.go | 6 +- .../baiducloud-blb/baiducloud_blb_test.go | 6 +- .../baiducloud-cdn/baiducloud_cdn_test.go | 6 +- .../baishan-cdn/baishan_cdn_test.go | 6 +- .../baotapanel_console_test.go | 6 +- .../baotapanel/baotapanel_test.go | 6 +- .../baotapanelgo_console_test.go | 6 +- .../baotapanelgo/baotapanelgo_test.go | 6 +- .../baotawaf-console/baotawaf_console_test.go | 6 +- .../baotawaf/baotawaf_test.go | 6 +- .../bunny-cdn/bunny_cdn_test.go | 6 +- .../byteplus-alb/byteplus_alb_test.go | 6 +- .../byteplus-apig/byteplus_apig_test.go | 6 +- .../byteplus-cdn/byteplus_cdn_test.go | 6 +- .../byteplus-clb/byteplus_clb_test.go | 6 +- .../byteplus_medialive_test.go | 6 +- .../byteplus-tos/byteplus_tos_test.go | 6 +- .../cachefly/cachefly_test.go | 6 +- .../cdnfly/cdnfly_test.go | 6 +- .../cloudflare-ssl/cloudflare_ssl_test.go | 6 +- .../cmcccloud-cdn/cmcccloud_cdn_test.go | 6 +- .../cmcccloud-vlb/cmcccloud_vlb_test.go | 8 +- .../cpanel/cpanel_test.go | 6 +- .../ctcccloud-ao/ctcccloud_ao_test.go | 6 +- .../ctcccloud-cdn/ctcccloud_cdn_test.go | 6 +- .../ctcccloud-cms/ctcccloud_cms_test.go | 6 +- .../ctcccloud-elb/ctcccloud_elb_test.go | 8 +- .../ctcccloud-faas/ctcccloud_faas_test.go | 6 +- .../ctcccloud-icdn/ctcccloud_icdn_test.go | 6 +- .../ctcccloud-lvdn/ctcccloud_lvdn_test.go | 6 +- .../dogecloud-cdn/dogecloud_cdn_test.go | 6 +- .../flexcdn/flexcdn_test.go | 6 +- .../flyio/flyio_test.go | 6 +- .../ftp/ftp_test.go | 6 +- .../gcore-cdn/gcore_cdn_test.go | 6 +- .../goedge/goedge_test.go | 6 +- .../huaweicloud-aad/huaweicloud_aad_test.go | 6 +- .../huaweicloud-apig/huaweicloud_apig_test.go | 6 +- .../huaweicloud-cdn/huaweicloud_cdn_test.go | 6 +- .../huaweicloud-elb/huaweicloud_elb_test.go | 10 +-- .../huaweicloud-live/huaweicloud_live_test.go | 6 +- .../huaweicloud-obs/huaweicloud_obs_test.go | 6 +- .../huaweicloud-vod/huaweicloud_vod_test.go | 6 +- .../huaweicloud-waf/huaweicloud_waf_test.go | 6 +- .../huaweiibmc/huaweiibmc_test.go | 6 +- .../jdcloud-alb/jdcloud_alb_test.go | 8 +- .../jdcloud-cdn/jdcloud_cdn_test.go | 6 +- .../jdcloud-live/jdcloud_live_test.go | 6 +- .../jdcloud-vod/jdcloud_vod_test.go | 6 +- .../jdcloud-waf/jdcloud_waf_test.go | 6 +- .../k8s-secret/k8s_secret_test.go | 66 ++++++++++++++ .../kong/kong_test.go | 6 +- .../ksyun-cdn/ksyun_cdn_test.go | 8 +- .../ksyun-slb/ksyun_slb_test.go | 6 +- .../lecdn/lecdn_test.go | 6 +- .../linode-los/linode_los_test.go | 6 +- .../local/local_test.go | 10 +-- .../mohua-mvh/mohua_mvh_test.go | 6 +- .../netlify/netlify_test.go | 6 +- .../nginxproxymanager_test.go | 6 +- .../proxmoxbs/proxmoxbs_test.go | 6 +- .../proxmoxve/proxmoxve_test.go | 6 +- .../qingcloud-lb/qingcloud_lb_test.go | 8 +- .../qiniu-cdn/qiniu_cdn_test.go | 6 +- .../qiniu-kodo/qiniu_kodo_test.go | 6 +- .../qiniu-pili/qiniu_pili_test.go | 6 +- .../rainyun-rcdn/rainyun_rcdn_test.go | 6 +- .../rainyun_sslcenter_test.go | 6 +- .../ratpanel-console/ratpanel_console_test.go | 6 +- .../ratpanel/ratpanel_test.go | 6 +- .../s3/s3_test.go | 6 +- .../safeline/safeline_test.go | 6 +- .../samwaf-console/samwaf_console_test.go | 6 +- .../samwaf/samwaf_test.go | 6 +- .../ssh/ssh_test.go | 6 +- .../synologydsm/synologydsm_test.go | 6 +- .../tencentcloud-cdn/tencentcloud_cdn_test.go | 6 +- .../tencentcloud-clb/tencentcloud_clb_test.go | 10 +-- .../tencentcloud-cos/tencentcloud_cos_test.go | 6 +- .../tencentcloud-css/tencentcloud_css_test.go | 6 +- .../tencentcloud_ecdn_test.go | 6 +- .../tencentcloud-eo/tencentcloud_eo_test.go | 6 +- .../tencentcloud_eomakers_test.go | 6 +- .../tencentcloud-ga2/tencentcloud_ga2_test.go | 6 +- .../tencentcloud_gaap_test.go | 6 +- .../tencentcloud-scf/tencentcloud_scf_test.go | 6 +- .../tencentcloud-vod/tencentcloud_vod_test.go | 6 +- .../tencentcloud-waf/tencentcloud_waf_test.go | 6 +- .../testing.go => providers-tester/tester.go} | 18 ++-- .../deployer/providers-tester/tester_args.go | 9 ++ .../ucloud-ualb/ucloud_ualb_test.go | 6 +- .../ucloud-ucdn/ucloud_ucdn_test.go | 6 +- .../ucloud-uclb/ucloud_uclb_test.go | 6 +- .../ucloud-uewaf/ucloud_uewaf_test.go | 6 +- .../ucloud-upathx/ucloud_upathx_test.go | 6 +- .../ucloud-us3/ucloud_us3_test.go | 6 +- .../unicloud-webhost/unicloud_webhost_test.go | 6 +- .../upyun-cdn/upyun_cdn_test.go | 6 +- .../upyun-file/upyun_file_test.go | 6 +- .../vercel/vercel_test.go | 6 +- .../volcengine-alb/volcengine_alb_test.go | 6 +- .../volcengine-apig/volcengine_apig_test.go | 6 +- .../volcengine-cdn/volcengine_cdn_test.go | 6 +- .../volcengine-clb/volcengine_clb_test.go | 6 +- .../volcengine-dcdn/volcengine_dcdn_test.go | 6 +- .../volcengine_imagex_test.go | 6 +- .../volcengine-live/volcengine_live_test.go | 6 +- .../volcengine-tos/volcengine_tos_test.go | 6 +- .../volcengine-vod/volcengine_vod_test.go | 6 +- .../volcengine-waf/volcengine_waf_test.go | 6 +- .../wangsu-cdn/wangsu_cdn_test.go | 6 +- .../wangsu-cdnpro/wangsu_cdnpro_test.go | 6 +- .../wangsu_certificate_test.go | 6 +- .../webhook/webhook_test.go | 6 +- .../zenlayer-cdn/zenlayer_cdn_test.go | 8 +- .../zenlayer-ga/zenlayer_ga_test.go | 8 +- .../k8s-secret/k8s_secret_client_test.go | 41 --------- .../providers/k8s-secret/k8s_secret_test.go | 89 +++++++------------ pkg/core/deployer/testing/args.go | 9 -- pkg/core/internal/testing/argsparser.go | 2 +- .../dingtalkbot/dingtalkbot_test.go | 6 +- .../discordbot/discordbot_test.go | 6 +- .../email/email_test.go | 8 +- .../larkbot/larkbot_test.go | 6 +- .../matrix/matrix_test.go | 6 +- .../mattermost/mattermost_test.go | 6 +- .../slackbot/slackbot_test.go | 6 +- .../telegrambot/telegrambot_test.go | 6 +- .../testing.go => providers-tester/tester.go} | 14 +-- .../notifier/providers-tester/tester_args.go | 9 ++ .../webhook/webhook_test.go | 6 +- .../wecombot/wecombot_test.go | 6 +- pkg/core/notifier/testing/args.go | 9 -- 209 files changed, 758 insertions(+), 758 deletions(-) rename pkg/core/certmgr/{providers => providers-tester}/1panel/1panel_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/aliyun-cas/aliyun_cas_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/aliyun-slb/aliyun_slb_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/aws-acm/aws_acm_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/aws-iam/aws_iam_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/axisnow/axisnow_test.go (78%) rename pkg/core/certmgr/{providers => providers-tester}/azure-keyvault/azure_keyvault_test.go (86%) rename pkg/core/certmgr/{providers => providers-tester}/baiducloud-cert/baiducloud_cert_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/baishan-cdn/baishan_cdn_test.go (79%) rename pkg/core/certmgr/{providers => providers-tester}/byteplus-cdn/byteplus_cdn_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/byteplus-certcenter/byteplus_certcenter_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/byteplus-medialive/byteplus_medialive_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/cmcccloud-vlb/cmcccloud_vlb_test.go (84%) rename pkg/core/certmgr/{providers => providers-tester}/ctcccloud-ao/ctcccloud_ao_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/ctcccloud-cdn/ctcccloud_cdn_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/ctcccloud-cms/ctcccloud_cms_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/ctcccloud-elb/ctcccloud_elb_test.go (84%) rename pkg/core/certmgr/{providers => providers-tester}/ctcccloud-icdn/ctcccloud_icdn_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/ctcccloud-lvdn/ctcccloud_lvdn_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/digitalocean-certificate/digitalocean_certificate_test.go (79%) rename pkg/core/certmgr/{providers => providers-tester}/dogecloud/dogecloud_test.go (81%) rename pkg/core/certmgr/{providers => providers-tester}/dokploy/dokploy_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/gcore-cdn/gcore_cdn_test.go (78%) rename pkg/core/certmgr/{providers => providers-tester}/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go (85%) rename pkg/core/certmgr/{providers => providers-tester}/huaweicloud-elb/huaweicloud_elb_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/huaweicloud-scm/huaweicloud_scm_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/huaweicloud-waf/huaweicloud_waf_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/jdcloud-ssl/jdcloud_ssl_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/ksyun-kcm/ksyun_kcm_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/ksyun-slb/ksyun_slb_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/nginxproxymanager/nginxproxymanager_test.go (84%) rename pkg/core/certmgr/{providers => providers-tester}/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go (89%) rename pkg/core/certmgr/{providers => providers-tester}/qingcloud-lb/qingcloud_lb_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/qiniu-sslcert/qiniu_sslcert_test.go (81%) rename pkg/core/certmgr/{providers => providers-tester}/rainyun-sslcenter/rainyun_sslcenter_test.go (79%) rename pkg/core/certmgr/{providers => providers-tester}/tencentcloud-gaap/tencentcloud_gaap_test.go (81%) rename pkg/core/certmgr/{providers => providers-tester}/tencentcloud-ssl/tencentcloud_ssl_test.go (81%) rename pkg/core/certmgr/{providers => providers-tester}/tencentcloud-tse/tencentcloud_tse_test.go (86%) rename pkg/core/certmgr/{testing/testing.go => providers-tester/tester.go} (57%) create mode 100644 pkg/core/certmgr/providers-tester/tester_args.go rename pkg/core/certmgr/{providers => providers-tester}/ucloud-ulb/ucloud_ulb_test.go (83%) rename pkg/core/certmgr/{providers => providers-tester}/ucloud-upathx/ucloud_upathx_test.go (81%) rename pkg/core/certmgr/{providers => providers-tester}/ucloud-ussl/ucloud_ussl_test.go (81%) rename pkg/core/certmgr/{providers => providers-tester}/upyun-ssl/upyun_ssl_test.go (81%) rename pkg/core/certmgr/{providers => providers-tester}/volcengine-cdn/volcengine_cdn_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/volcengine-certcenter/volcengine_certcenter_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/volcengine-live/volcengine_live_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/wangsu-certificate/wangsu_certificate_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go (85%) rename pkg/core/certmgr/{providers => providers-tester}/zenlayer-cdn/zenlayer_cdn_test.go (82%) rename pkg/core/certmgr/{providers => providers-tester}/zenlayer-ga/zenlayer_ga_test.go (82%) delete mode 100644 pkg/core/certmgr/testing/args.go rename pkg/core/deployer/{providers => providers-tester}/1panel-console/1panel_console_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/1panel/1panel_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-alb/aliyun_alb_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-apigw/aliyun_apigw_test.go (88%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-cdn/aliyun_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-clb/aliyun_clb_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-dcdn/aliyun_dcdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-ddospro/aliyun_ddospro_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-esa-saas/aliyun_esasaas_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-esa/aliyun_esa_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-fc/aliyun_fc_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-ga/aliyun_ga_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-live/aliyun_live_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-nlb/aliyun_nlb_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-oss/aliyun_oss_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-vod/aliyun_vod_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/aliyun-waf/aliyun_waf_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/apisix/apisix_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/aws-alb/aws_alb_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/aws-amplify/aws_amplify_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/aws-apigateway/aws_apigateway_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/aws-clb/aws_clb_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/aws-cloudfront/aws_cloudfront_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/aws-nlb/aws_nlb_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/baiducloud-appblb/baiducloud_appblb_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/baiducloud-blb/baiducloud_blb_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/baiducloud-cdn/baiducloud_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/baishan-cdn/baishan_cdn_test.go (82%) rename pkg/core/deployer/{providers => providers-tester}/baotapanel-console/baotapanel_console_test.go (82%) rename pkg/core/deployer/{providers => providers-tester}/baotapanel/baotapanel_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/baotapanelgo-console/baotapanelgo_console_test.go (82%) rename pkg/core/deployer/{providers => providers-tester}/baotapanelgo/baotapanelgo_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/baotawaf-console/baotawaf_console_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/baotawaf/baotawaf_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/bunny-cdn/bunny_cdn_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/byteplus-alb/byteplus_alb_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/byteplus-apig/byteplus_apig_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/byteplus-cdn/byteplus_cdn_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/byteplus-clb/byteplus_clb_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/byteplus-medialive/byteplus_medialive_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/byteplus-tos/byteplus_tos_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/cachefly/cachefly_test.go (78%) rename pkg/core/deployer/{providers => providers-tester}/cdnfly/cdnfly_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/cloudflare-ssl/cloudflare_ssl_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/cmcccloud-cdn/cmcccloud_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/cmcccloud-vlb/cmcccloud_vlb_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/cpanel/cpanel_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/ctcccloud-ao/ctcccloud_ao_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/ctcccloud-cdn/ctcccloud_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/ctcccloud-cms/ctcccloud_cms_test.go (82%) rename pkg/core/deployer/{providers => providers-tester}/ctcccloud-elb/ctcccloud_elb_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/ctcccloud-faas/ctcccloud_faas_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/ctcccloud-icdn/ctcccloud_icdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/ctcccloud-lvdn/ctcccloud_lvdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/dogecloud-cdn/dogecloud_cdn_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/flexcdn/flexcdn_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/flyio/flyio_test.go (82%) rename pkg/core/deployer/{providers => providers-tester}/ftp/ftp_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/gcore-cdn/gcore_cdn_test.go (81%) rename pkg/core/deployer/{providers => providers-tester}/goedge/goedge_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/huaweicloud-aad/huaweicloud_aad_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/huaweicloud-apig/huaweicloud_apig_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/huaweicloud-cdn/huaweicloud_cdn_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/huaweicloud-elb/huaweicloud_elb_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/huaweicloud-live/huaweicloud_live_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/huaweicloud-obs/huaweicloud_obs_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/huaweicloud-vod/huaweicloud_vod_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/huaweicloud-waf/huaweicloud_waf_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/huaweiibmc/huaweiibmc_test.go (82%) rename pkg/core/deployer/{providers => providers-tester}/jdcloud-alb/jdcloud_alb_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/jdcloud-cdn/jdcloud_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/jdcloud-live/jdcloud_live_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/jdcloud-vod/jdcloud_vod_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/jdcloud-waf/jdcloud_waf_test.go (85%) create mode 100644 pkg/core/deployer/providers-tester/k8s-secret/k8s_secret_test.go rename pkg/core/deployer/{providers => providers-tester}/kong/kong_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/ksyun-cdn/ksyun_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/ksyun-slb/ksyun_slb_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/lecdn/lecdn_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/linode-los/linode_los_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/local/local_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/mohua-mvh/mohua_mvh_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/netlify/netlify_test.go (81%) rename pkg/core/deployer/{providers => providers-tester}/nginxproxymanager/nginxproxymanager_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/proxmoxbs/proxmoxbs_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/proxmoxve/proxmoxve_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/qingcloud-lb/qingcloud_lb_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/qiniu-cdn/qiniu_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/qiniu-kodo/qiniu_kodo_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/qiniu-pili/qiniu_pili_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/rainyun-rcdn/rainyun_rcdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/rainyun-sslcenter/rainyun_sslcenter_test.go (78%) rename pkg/core/deployer/{providers => providers-tester}/ratpanel-console/ratpanel_console_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/ratpanel/ratpanel_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/s3/s3_test.go (88%) rename pkg/core/deployer/{providers => providers-tester}/safeline/safeline_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/samwaf-console/samwaf_console_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/samwaf/samwaf_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/ssh/ssh_test.go (88%) rename pkg/core/deployer/{providers => providers-tester}/synologydsm/synologydsm_test.go (88%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-cdn/tencentcloud_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-clb/tencentcloud_clb_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-cos/tencentcloud_cos_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-css/tencentcloud_css_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-ecdn/tencentcloud_ecdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-eo/tencentcloud_eo_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-eomakers/tencentcloud_eomakers_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-ga2/tencentcloud_ga2_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-gaap/tencentcloud_gaap_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-scf/tencentcloud_scf_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-vod/tencentcloud_vod_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/tencentcloud-waf/tencentcloud_waf_test.go (87%) rename pkg/core/deployer/{testing/testing.go => providers-tester/tester.go} (57%) create mode 100644 pkg/core/deployer/providers-tester/tester_args.go rename pkg/core/deployer/{providers => providers-tester}/ucloud-ualb/ucloud_ualb_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/ucloud-ucdn/ucloud_ucdn_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/ucloud-uclb/ucloud_uclb_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/ucloud-uewaf/ucloud_uewaf_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/ucloud-upathx/ucloud_upathx_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/ucloud-us3/ucloud_us3_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/unicloud-webhost/unicloud_webhost_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/upyun-cdn/upyun_cdn_test.go (82%) rename pkg/core/deployer/{providers => providers-tester}/upyun-file/upyun_file_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/vercel/vercel_test.go (81%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-alb/volcengine_alb_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-apig/volcengine_apig_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-cdn/volcengine_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-clb/volcengine_clb_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-dcdn/volcengine_dcdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-imagex/volcengine_imagex_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-live/volcengine_live_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-tos/volcengine_tos_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-vod/volcengine_vod_test.go (87%) rename pkg/core/deployer/{providers => providers-tester}/volcengine-waf/volcengine_waf_test.go (86%) rename pkg/core/deployer/{providers => providers-tester}/wangsu-cdn/wangsu_cdn_test.go (83%) rename pkg/core/deployer/{providers => providers-tester}/wangsu-cdnpro/wangsu_cdnpro_test.go (88%) rename pkg/core/deployer/{providers => providers-tester}/wangsu-certificate/wangsu_certificate_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/webhook/webhook_test.go (85%) rename pkg/core/deployer/{providers => providers-tester}/zenlayer-cdn/zenlayer_cdn_test.go (84%) rename pkg/core/deployer/{providers => providers-tester}/zenlayer-ga/zenlayer_ga_test.go (84%) delete mode 100644 pkg/core/deployer/providers/k8s-secret/k8s_secret_client_test.go delete mode 100644 pkg/core/deployer/testing/args.go rename pkg/core/notifier/{providers => providers-tester}/dingtalkbot/dingtalkbot_test.go (80%) rename pkg/core/notifier/{providers => providers-tester}/discordbot/discordbot_test.go (80%) rename pkg/core/notifier/{providers => providers-tester}/email/email_test.go (89%) rename pkg/core/notifier/{providers => providers-tester}/larkbot/larkbot_test.go (80%) rename pkg/core/notifier/{providers => providers-tester}/matrix/matrix_test.go (85%) rename pkg/core/notifier/{providers => providers-tester}/mattermost/mattermost_test.go (84%) rename pkg/core/notifier/{providers => providers-tester}/slackbot/slackbot_test.go (80%) rename pkg/core/notifier/{providers => providers-tester}/telegrambot/telegrambot_test.go (80%) rename pkg/core/notifier/{testing/testing.go => providers-tester/tester.go} (57%) create mode 100644 pkg/core/notifier/providers-tester/tester_args.go rename pkg/core/notifier/{providers => providers-tester}/webhook/webhook_test.go (82%) rename pkg/core/notifier/{providers => providers-tester}/wecombot/wecombot_test.go (77%) delete mode 100644 pkg/core/notifier/testing/args.go diff --git a/pkg/core/certmgr/providers/1panel/1panel_test.go b/pkg/core/certmgr/providers-tester/1panel/1panel_test.go similarity index 83% rename from pkg/core/certmgr/providers/1panel/1panel_test.go rename to pkg/core/certmgr/providers-tester/1panel/1panel_test.go index a8fb4afc2..5468484ef 100644 --- a/pkg/core/certmgr/providers/1panel/1panel_test.go +++ b/pkg/core/certmgr/providers-tester/1panel/1panel_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/1panel" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("1PANEL_") + fp = tester.InitArgs("1PANEL_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/aliyun-cas/aliyun_cas_test.go b/pkg/core/certmgr/providers-tester/aliyun-cas/aliyun_cas_test.go similarity index 83% rename from pkg/core/certmgr/providers/aliyun-cas/aliyun_cas_test.go rename to pkg/core/certmgr/providers-tester/aliyun-cas/aliyun_cas_test.go index 61eb507f4..834ca9d38 100644 --- a/pkg/core/certmgr/providers/aliyun-cas/aliyun_cas_test.go +++ b/pkg/core/certmgr/providers-tester/aliyun-cas/aliyun_cas_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/aliyun-cas" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("ALIYUNCAS_") + fp = tester.InitArgs("ALIYUNCAS_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/aliyun-slb/aliyun_slb_test.go b/pkg/core/certmgr/providers-tester/aliyun-slb/aliyun_slb_test.go similarity index 83% rename from pkg/core/certmgr/providers/aliyun-slb/aliyun_slb_test.go rename to pkg/core/certmgr/providers-tester/aliyun-slb/aliyun_slb_test.go index 74567f9f7..98755dd93 100644 --- a/pkg/core/certmgr/providers/aliyun-slb/aliyun_slb_test.go +++ b/pkg/core/certmgr/providers-tester/aliyun-slb/aliyun_slb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/aliyun-slb" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("ALIYUNSLB_") + fp = tester.InitArgs("ALIYUNSLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/aws-acm/aws_acm_test.go b/pkg/core/certmgr/providers-tester/aws-acm/aws_acm_test.go similarity index 83% rename from pkg/core/certmgr/providers/aws-acm/aws_acm_test.go rename to pkg/core/certmgr/providers-tester/aws-acm/aws_acm_test.go index ca516cef3..283d37c33 100644 --- a/pkg/core/certmgr/providers/aws-acm/aws_acm_test.go +++ b/pkg/core/certmgr/providers-tester/aws-acm/aws_acm_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/aws-acm" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("AWSACM_") + fp = tester.InitArgs("AWSACM_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/aws-iam/aws_iam_test.go b/pkg/core/certmgr/providers-tester/aws-iam/aws_iam_test.go similarity index 83% rename from pkg/core/certmgr/providers/aws-iam/aws_iam_test.go rename to pkg/core/certmgr/providers-tester/aws-iam/aws_iam_test.go index 0cffd4520..e89a44aba 100644 --- a/pkg/core/certmgr/providers/aws-iam/aws_iam_test.go +++ b/pkg/core/certmgr/providers-tester/aws-iam/aws_iam_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/aws-iam" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("AWSIAM_") + fp = tester.InitArgs("AWSIAM_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/axisnow/axisnow_test.go b/pkg/core/certmgr/providers-tester/axisnow/axisnow_test.go similarity index 78% rename from pkg/core/certmgr/providers/axisnow/axisnow_test.go rename to pkg/core/certmgr/providers-tester/axisnow/axisnow_test.go index 2870243ce..098f7bc21 100644 --- a/pkg/core/certmgr/providers/axisnow/axisnow_test.go +++ b/pkg/core/certmgr/providers-tester/axisnow/axisnow_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/axisnow" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("AXISNOW_") + fp = tester.InitArgs("AXISNOW_") fTestCertPath string fTestKeyPath string fApiToken string @@ -39,6 +39,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/azure-keyvault/azure_keyvault_test.go b/pkg/core/certmgr/providers-tester/azure-keyvault/azure_keyvault_test.go similarity index 86% rename from pkg/core/certmgr/providers/azure-keyvault/azure_keyvault_test.go rename to pkg/core/certmgr/providers-tester/azure-keyvault/azure_keyvault_test.go index eac69b0a2..9977a0be0 100644 --- a/pkg/core/certmgr/providers/azure-keyvault/azure_keyvault_test.go +++ b/pkg/core/certmgr/providers-tester/azure-keyvault/azure_keyvault_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/azure-keyvault" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("AZUREKEYVAULT_") + fp = tester.InitArgs("AZUREKEYVAULT_") fTestCertPath string fTestKeyPath string fTenantId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/baiducloud-cert/baiducloud_cert_test.go b/pkg/core/certmgr/providers-tester/baiducloud-cert/baiducloud_cert_test.go similarity index 82% rename from pkg/core/certmgr/providers/baiducloud-cert/baiducloud_cert_test.go rename to pkg/core/certmgr/providers-tester/baiducloud-cert/baiducloud_cert_test.go index 6f014c2f9..6be385909 100644 --- a/pkg/core/certmgr/providers/baiducloud-cert/baiducloud_cert_test.go +++ b/pkg/core/certmgr/providers-tester/baiducloud-cert/baiducloud_cert_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/baiducloud-cert" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("BAIDUCLOUDCERT_") + fp = tester.InitArgs("BAIDUCLOUDCERT_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/baishan-cdn/baishan_cdn_test.go b/pkg/core/certmgr/providers-tester/baishan-cdn/baishan_cdn_test.go similarity index 79% rename from pkg/core/certmgr/providers/baishan-cdn/baishan_cdn_test.go rename to pkg/core/certmgr/providers-tester/baishan-cdn/baishan_cdn_test.go index b39395524..a9906a1d0 100644 --- a/pkg/core/certmgr/providers/baishan-cdn/baishan_cdn_test.go +++ b/pkg/core/certmgr/providers-tester/baishan-cdn/baishan_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/baishan-cdn" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("BAISHANCDN_") + fp = tester.InitArgs("BAISHANCDN_") fTestCertPath string fTestKeyPath string fApiToken string @@ -39,6 +39,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/byteplus-cdn/byteplus_cdn_test.go b/pkg/core/certmgr/providers-tester/byteplus-cdn/byteplus_cdn_test.go similarity index 82% rename from pkg/core/certmgr/providers/byteplus-cdn/byteplus_cdn_test.go rename to pkg/core/certmgr/providers-tester/byteplus-cdn/byteplus_cdn_test.go index fa44ae37a..8473f2dcf 100644 --- a/pkg/core/certmgr/providers/byteplus-cdn/byteplus_cdn_test.go +++ b/pkg/core/certmgr/providers-tester/byteplus-cdn/byteplus_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/byteplus-cdn" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("BYTEPLUSCDN_") + fp = tester.InitArgs("BYTEPLUSCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/byteplus-certcenter/byteplus_certcenter_test.go b/pkg/core/certmgr/providers-tester/byteplus-certcenter/byteplus_certcenter_test.go similarity index 82% rename from pkg/core/certmgr/providers/byteplus-certcenter/byteplus_certcenter_test.go rename to pkg/core/certmgr/providers-tester/byteplus-certcenter/byteplus_certcenter_test.go index 1a4cb30cd..95d5abead 100644 --- a/pkg/core/certmgr/providers/byteplus-certcenter/byteplus_certcenter_test.go +++ b/pkg/core/certmgr/providers-tester/byteplus-certcenter/byteplus_certcenter_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/byteplus-certcenter" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("BYTEPLUSCERTCENTER_") + fp = tester.InitArgs("BYTEPLUSCERTCENTER_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/byteplus-medialive/byteplus_medialive_test.go b/pkg/core/certmgr/providers-tester/byteplus-medialive/byteplus_medialive_test.go similarity index 82% rename from pkg/core/certmgr/providers/byteplus-medialive/byteplus_medialive_test.go rename to pkg/core/certmgr/providers-tester/byteplus-medialive/byteplus_medialive_test.go index 1a24127b8..fdfdcf178 100644 --- a/pkg/core/certmgr/providers/byteplus-medialive/byteplus_medialive_test.go +++ b/pkg/core/certmgr/providers-tester/byteplus-medialive/byteplus_medialive_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/byteplus-medialive" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("BYTEPLUSMEDIALIVE_") + fp = tester.InitArgs("BYTEPLUSMEDIALIVE_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb_test.go b/pkg/core/certmgr/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go similarity index 84% rename from pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb_test.go rename to pkg/core/certmgr/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go index 45e52b47f..68e8d5055 100644 --- a/pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb_test.go +++ b/pkg/core/certmgr/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/cmcccloud-vlb" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("CMCCCLOUDVLB_") + fp = tester.InitArgs("CMCCCLOUDVLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ctcccloud-ao/ctcccloud_ao_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go similarity index 82% rename from pkg/core/certmgr/providers/ctcccloud-ao/ctcccloud_ao_test.go rename to pkg/core/certmgr/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go index 2be59f21f..4c2138913 100644 --- a/pkg/core/certmgr/providers/ctcccloud-ao/ctcccloud_ao_test.go +++ b/pkg/core/certmgr/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-ao" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("CTCCCLOUDAO_") + fp = tester.InitArgs("CTCCCLOUDAO_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ctcccloud-cdn/ctcccloud_cdn_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go similarity index 82% rename from pkg/core/certmgr/providers/ctcccloud-cdn/ctcccloud_cdn_test.go rename to pkg/core/certmgr/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go index d821b0cff..4c18c98e3 100644 --- a/pkg/core/certmgr/providers/ctcccloud-cdn/ctcccloud_cdn_test.go +++ b/pkg/core/certmgr/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-cdn" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("CTCCCLOUDCDN_") + fp = tester.InitArgs("CTCCCLOUDCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ctcccloud-cms/ctcccloud_cms_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go similarity index 82% rename from pkg/core/certmgr/providers/ctcccloud-cms/ctcccloud_cms_test.go rename to pkg/core/certmgr/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go index 83bad09db..f92e9eab0 100644 --- a/pkg/core/certmgr/providers/ctcccloud-cms/ctcccloud_cms_test.go +++ b/pkg/core/certmgr/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-cms" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("CTCCCLOUDCMS_") + fp = tester.InitArgs("CTCCCLOUDCMS_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ctcccloud-elb/ctcccloud_elb_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go similarity index 84% rename from pkg/core/certmgr/providers/ctcccloud-elb/ctcccloud_elb_test.go rename to pkg/core/certmgr/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go index 4dcc1cd2e..03f136254 100644 --- a/pkg/core/certmgr/providers/ctcccloud-elb/ctcccloud_elb_test.go +++ b/pkg/core/certmgr/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-elb" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("CTCCCLOUDELB_") + fp = tester.InitArgs("CTCCCLOUDELB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ctcccloud-icdn/ctcccloud_icdn_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go similarity index 82% rename from pkg/core/certmgr/providers/ctcccloud-icdn/ctcccloud_icdn_test.go rename to pkg/core/certmgr/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go index e85d0e232..da9c63e62 100644 --- a/pkg/core/certmgr/providers/ctcccloud-icdn/ctcccloud_icdn_test.go +++ b/pkg/core/certmgr/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-icdn" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("CTCCCLOUDICDN_") + fp = tester.InitArgs("CTCCCLOUDICDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go similarity index 82% rename from pkg/core/certmgr/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go rename to pkg/core/certmgr/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go index 44f5b709b..fb4c33cff 100644 --- a/pkg/core/certmgr/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go +++ b/pkg/core/certmgr/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-lvdn" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("CTCCCLOUDLVDN_") + fp = tester.InitArgs("CTCCCLOUDLVDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/digitalocean-certificate/digitalocean_certificate_test.go b/pkg/core/certmgr/providers-tester/digitalocean-certificate/digitalocean_certificate_test.go similarity index 79% rename from pkg/core/certmgr/providers/digitalocean-certificate/digitalocean_certificate_test.go rename to pkg/core/certmgr/providers-tester/digitalocean-certificate/digitalocean_certificate_test.go index 297635d96..4a2a3ea63 100644 --- a/pkg/core/certmgr/providers/digitalocean-certificate/digitalocean_certificate_test.go +++ b/pkg/core/certmgr/providers-tester/digitalocean-certificate/digitalocean_certificate_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/digitalocean-certificate" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("DIGITALOCEANCERTIFICATE_") + fp = tester.InitArgs("DIGITALOCEANCERTIFICATE_") fTestCertPath string fTestKeyPath string fAccessToken string @@ -39,6 +39,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/dogecloud/dogecloud_test.go b/pkg/core/certmgr/providers-tester/dogecloud/dogecloud_test.go similarity index 81% rename from pkg/core/certmgr/providers/dogecloud/dogecloud_test.go rename to pkg/core/certmgr/providers-tester/dogecloud/dogecloud_test.go index b029b423f..6add97d97 100644 --- a/pkg/core/certmgr/providers/dogecloud/dogecloud_test.go +++ b/pkg/core/certmgr/providers-tester/dogecloud/dogecloud_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/dogecloud" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("DOGECLOUD_") + fp = tester.InitArgs("DOGECLOUD_") fTestCertPath string fTestKeyPath string fAccessKey string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/dokploy/dokploy_test.go b/pkg/core/certmgr/providers-tester/dokploy/dokploy_test.go similarity index 82% rename from pkg/core/certmgr/providers/dokploy/dokploy_test.go rename to pkg/core/certmgr/providers-tester/dokploy/dokploy_test.go index 307e904b6..cbbefcca0 100644 --- a/pkg/core/certmgr/providers/dokploy/dokploy_test.go +++ b/pkg/core/certmgr/providers-tester/dokploy/dokploy_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/dokploy" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("DOKPLOY_") + fp = tester.InitArgs("DOKPLOY_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -44,6 +44,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/gcore-cdn/gcore_cdn_test.go b/pkg/core/certmgr/providers-tester/gcore-cdn/gcore_cdn_test.go similarity index 78% rename from pkg/core/certmgr/providers/gcore-cdn/gcore_cdn_test.go rename to pkg/core/certmgr/providers-tester/gcore-cdn/gcore_cdn_test.go index 2474fc742..dd947c541 100644 --- a/pkg/core/certmgr/providers/gcore-cdn/gcore_cdn_test.go +++ b/pkg/core/certmgr/providers-tester/gcore-cdn/gcore_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/gcore-cdn" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("GCORECDN_") + fp = tester.InitArgs("GCORECDN_") fTestCertPath string fTestKeyPath string fApiToken string @@ -39,6 +39,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go b/pkg/core/certmgr/providers-tester/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go similarity index 85% rename from pkg/core/certmgr/providers/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go rename to pkg/core/certmgr/providers-tester/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go index 63d80f092..a59faca56 100644 --- a/pkg/core/certmgr/providers/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go +++ b/pkg/core/certmgr/providers-tester/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go @@ -6,12 +6,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/googlecloud-certificatemanager" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("GOOGLECLOUDCERTIFICATEMANAGER_") + fp = tester.InitArgs("GOOGLECLOUDCERTIFICATEMANAGER_") fTestCertPath string fTestKeyPath string fProjectId string @@ -49,6 +49,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/huaweicloud-elb/huaweicloud_elb_test.go b/pkg/core/certmgr/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go similarity index 83% rename from pkg/core/certmgr/providers/huaweicloud-elb/huaweicloud_elb_test.go rename to pkg/core/certmgr/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go index ce063c7c3..181fd2fd2 100644 --- a/pkg/core/certmgr/providers/huaweicloud-elb/huaweicloud_elb_test.go +++ b/pkg/core/certmgr/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/huaweicloud-elb" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("HUAWEICLOUDELB_") + fp = tester.InitArgs("HUAWEICLOUDELB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/huaweicloud-scm/huaweicloud_scm_test.go b/pkg/core/certmgr/providers-tester/huaweicloud-scm/huaweicloud_scm_test.go similarity index 83% rename from pkg/core/certmgr/providers/huaweicloud-scm/huaweicloud_scm_test.go rename to pkg/core/certmgr/providers-tester/huaweicloud-scm/huaweicloud_scm_test.go index b0fdedb37..536f1a8de 100644 --- a/pkg/core/certmgr/providers/huaweicloud-scm/huaweicloud_scm_test.go +++ b/pkg/core/certmgr/providers-tester/huaweicloud-scm/huaweicloud_scm_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/huaweicloud-scm" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("HUAWEICLOUDSCM_") + fp = tester.InitArgs("HUAWEICLOUDSCM_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/huaweicloud-waf/huaweicloud_waf_test.go b/pkg/core/certmgr/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go similarity index 83% rename from pkg/core/certmgr/providers/huaweicloud-waf/huaweicloud_waf_test.go rename to pkg/core/certmgr/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go index 4f3f45d04..bc39ea2f9 100644 --- a/pkg/core/certmgr/providers/huaweicloud-waf/huaweicloud_waf_test.go +++ b/pkg/core/certmgr/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/huaweicloud-waf" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("HUAWEICLOUDWAF_") + fp = tester.InitArgs("HUAWEICLOUDWAF_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/jdcloud-ssl/jdcloud_ssl_test.go b/pkg/core/certmgr/providers-tester/jdcloud-ssl/jdcloud_ssl_test.go similarity index 82% rename from pkg/core/certmgr/providers/jdcloud-ssl/jdcloud_ssl_test.go rename to pkg/core/certmgr/providers-tester/jdcloud-ssl/jdcloud_ssl_test.go index 0f987b9be..5425c72b9 100644 --- a/pkg/core/certmgr/providers/jdcloud-ssl/jdcloud_ssl_test.go +++ b/pkg/core/certmgr/providers-tester/jdcloud-ssl/jdcloud_ssl_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/jdcloud-ssl" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("JDCLOUDSSL_") + fp = tester.InitArgs("JDCLOUDSSL_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ksyun-kcm/ksyun_kcm_test.go b/pkg/core/certmgr/providers-tester/ksyun-kcm/ksyun_kcm_test.go similarity index 82% rename from pkg/core/certmgr/providers/ksyun-kcm/ksyun_kcm_test.go rename to pkg/core/certmgr/providers-tester/ksyun-kcm/ksyun_kcm_test.go index 2ce2e7f67..ef9cd4de6 100644 --- a/pkg/core/certmgr/providers/ksyun-kcm/ksyun_kcm_test.go +++ b/pkg/core/certmgr/providers-tester/ksyun-kcm/ksyun_kcm_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ksyun-kcm" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("KSYUNKCM_") + fp = tester.InitArgs("KSYUNKCM_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ksyun-slb/ksyun_slb_test.go b/pkg/core/certmgr/providers-tester/ksyun-slb/ksyun_slb_test.go similarity index 83% rename from pkg/core/certmgr/providers/ksyun-slb/ksyun_slb_test.go rename to pkg/core/certmgr/providers-tester/ksyun-slb/ksyun_slb_test.go index e140788a8..cd85eb222 100644 --- a/pkg/core/certmgr/providers/ksyun-slb/ksyun_slb_test.go +++ b/pkg/core/certmgr/providers-tester/ksyun-slb/ksyun_slb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ksyun-slb" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("KSYUNSLB_") + fp = tester.InitArgs("KSYUNSLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/nginxproxymanager/nginxproxymanager_test.go b/pkg/core/certmgr/providers-tester/nginxproxymanager/nginxproxymanager_test.go similarity index 84% rename from pkg/core/certmgr/providers/nginxproxymanager/nginxproxymanager_test.go rename to pkg/core/certmgr/providers-tester/nginxproxymanager/nginxproxymanager_test.go index b06dc8950..93b16ed08 100644 --- a/pkg/core/certmgr/providers/nginxproxymanager/nginxproxymanager_test.go +++ b/pkg/core/certmgr/providers-tester/nginxproxymanager/nginxproxymanager_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/nginxproxymanager" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("NGINXPROXYMANAGER_") + fp = tester.InitArgs("NGINXPROXYMANAGER_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -49,6 +49,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go b/pkg/core/certmgr/providers-tester/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go similarity index 89% rename from pkg/core/certmgr/providers/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go rename to pkg/core/certmgr/providers-tester/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go index 59d979bd3..af00ef6ac 100644 --- a/pkg/core/certmgr/providers/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go +++ b/pkg/core/certmgr/providers-tester/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/oraclecloud-certificatesmgmt" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("ORACLECLOUDCERTIFICATESMGMT_") + fp = tester.InitArgs("ORACLECLOUDCERTIFICATESMGMT_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -60,6 +60,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/qingcloud-lb/qingcloud_lb_test.go b/pkg/core/certmgr/providers-tester/qingcloud-lb/qingcloud_lb_test.go similarity index 83% rename from pkg/core/certmgr/providers/qingcloud-lb/qingcloud_lb_test.go rename to pkg/core/certmgr/providers-tester/qingcloud-lb/qingcloud_lb_test.go index f8f9a6ac4..ab24233f2 100644 --- a/pkg/core/certmgr/providers/qingcloud-lb/qingcloud_lb_test.go +++ b/pkg/core/certmgr/providers-tester/qingcloud-lb/qingcloud_lb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/qingcloud-lb" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("QINGCLOUDLB_") + fp = tester.InitArgs("QINGCLOUDLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/qiniu-sslcert/qiniu_sslcert_test.go b/pkg/core/certmgr/providers-tester/qiniu-sslcert/qiniu_sslcert_test.go similarity index 81% rename from pkg/core/certmgr/providers/qiniu-sslcert/qiniu_sslcert_test.go rename to pkg/core/certmgr/providers-tester/qiniu-sslcert/qiniu_sslcert_test.go index 1b4727e43..3940cd552 100644 --- a/pkg/core/certmgr/providers/qiniu-sslcert/qiniu_sslcert_test.go +++ b/pkg/core/certmgr/providers-tester/qiniu-sslcert/qiniu_sslcert_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/qiniu-sslcert" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("QINIUSSLCERT_") + fp = tester.InitArgs("QINIUSSLCERT_") fTestCertPath string fTestKeyPath string fAccessKey string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/rainyun-sslcenter/rainyun_sslcenter_test.go b/pkg/core/certmgr/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go similarity index 79% rename from pkg/core/certmgr/providers/rainyun-sslcenter/rainyun_sslcenter_test.go rename to pkg/core/certmgr/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go index 164bb3844..db70319d2 100644 --- a/pkg/core/certmgr/providers/rainyun-sslcenter/rainyun_sslcenter_test.go +++ b/pkg/core/certmgr/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/rainyun-sslcenter" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("RAINYUNSSLCENTER_") + fp = tester.InitArgs("RAINYUNSSLCENTER_") fTestCertPath string fTestKeyPath string fApiKey string @@ -39,6 +39,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/tencentcloud-gaap/tencentcloud_gaap_test.go b/pkg/core/certmgr/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go similarity index 81% rename from pkg/core/certmgr/providers/tencentcloud-gaap/tencentcloud_gaap_test.go rename to pkg/core/certmgr/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go index 256aa70de..83a02a8d3 100644 --- a/pkg/core/certmgr/providers/tencentcloud-gaap/tencentcloud_gaap_test.go +++ b/pkg/core/certmgr/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/tencentcloud-gaap" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("TENCENTCLOUDGAAP_") + fp = tester.InitArgs("TENCENTCLOUDGAAP_") fTestCertPath string fTestKeyPath string fSecretId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/tencentcloud-ssl/tencentcloud_ssl_test.go b/pkg/core/certmgr/providers-tester/tencentcloud-ssl/tencentcloud_ssl_test.go similarity index 81% rename from pkg/core/certmgr/providers/tencentcloud-ssl/tencentcloud_ssl_test.go rename to pkg/core/certmgr/providers-tester/tencentcloud-ssl/tencentcloud_ssl_test.go index 665230f1a..72378be59 100644 --- a/pkg/core/certmgr/providers/tencentcloud-ssl/tencentcloud_ssl_test.go +++ b/pkg/core/certmgr/providers-tester/tencentcloud-ssl/tencentcloud_ssl_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/tencentcloud-ssl" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("TENCENTCLOUDSSL_") + fp = tester.InitArgs("TENCENTCLOUDSSL_") fTestCertPath string fTestKeyPath string fSecretId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/tencentcloud-tse/tencentcloud_tse_test.go b/pkg/core/certmgr/providers-tester/tencentcloud-tse/tencentcloud_tse_test.go similarity index 86% rename from pkg/core/certmgr/providers/tencentcloud-tse/tencentcloud_tse_test.go rename to pkg/core/certmgr/providers-tester/tencentcloud-tse/tencentcloud_tse_test.go index 32a91271b..20859dc59 100644 --- a/pkg/core/certmgr/providers/tencentcloud-tse/tencentcloud_tse_test.go +++ b/pkg/core/certmgr/providers-tester/tencentcloud-tse/tencentcloud_tse_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/tencentcloud-tse" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("TENCENTCLOUDTSE_") + fp = tester.InitArgs("TENCENTCLOUDTSE_") fTestCertPath string fTestKeyPath string fSecretId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/testing/testing.go b/pkg/core/certmgr/providers-tester/tester.go similarity index 57% rename from pkg/core/certmgr/testing/testing.go rename to pkg/core/certmgr/providers-tester/tester.go index cf26b9add..f43681319 100644 --- a/pkg/core/certmgr/testing/testing.go +++ b/pkg/core/certmgr/providers-tester/tester.go @@ -1,4 +1,4 @@ -package testing +package tester import ( "context" @@ -13,33 +13,33 @@ import ( "github.com/certimate-go/certimate/pkg/core/certmgr" ) -type TestUploadArgs struct { +type UploadInput struct { CertPath string KeyPath string } -func TestUpload(t *testing.T, testProvider certmgr.Provider, testArgs TestUploadArgs) { - if _, err := os.Stat(testArgs.CertPath); os.IsNotExist(err) { +func Upload(t *testing.T, provider certmgr.Provider, input UploadInput) { + if _, err := os.Stat(input.CertPath); os.IsNotExist(err) { t.Errorf("err: test cert file not exist") return } - if _, err := os.Stat(testArgs.KeyPath); os.IsNotExist(err) { + if _, err := os.Stat(input.KeyPath); os.IsNotExist(err) { t.Errorf("err: test privkey file not exist") return } ctx := context.Background() - certData, _ := os.ReadFile(testArgs.CertPath) - privkeyData, _ := os.ReadFile(testArgs.KeyPath) + certData, _ := os.ReadFile(input.CertPath) + privkeyData, _ := os.ReadFile(input.KeyPath) assert.NotNil(t, certData) assert.NotNil(t, privkeyData) logger := slog.Default() logger.Enabled(ctx, slog.LevelDebug) - testProvider.SetLogger(logger) + provider.SetLogger(logger) - res, err := testProvider.Upload(ctx, string(certData), string(privkeyData)) + res, err := provider.Upload(ctx, string(certData), string(privkeyData)) require.NoError(t, err) require.NotNil(t, res) diff --git a/pkg/core/certmgr/providers-tester/tester_args.go b/pkg/core/certmgr/providers-tester/tester_args.go new file mode 100644 index 000000000..adcdc3dba --- /dev/null +++ b/pkg/core/certmgr/providers-tester/tester_args.go @@ -0,0 +1,9 @@ +package tester + +import ( + "github.com/certimate-go/certimate/pkg/core/internal/testing" +) + +func InitArgs(prefix string) testing.ArgsParser { + return testing.InitArgs(prefix) +} diff --git a/pkg/core/certmgr/providers/ucloud-ulb/ucloud_ulb_test.go b/pkg/core/certmgr/providers-tester/ucloud-ulb/ucloud_ulb_test.go similarity index 83% rename from pkg/core/certmgr/providers/ucloud-ulb/ucloud_ulb_test.go rename to pkg/core/certmgr/providers-tester/ucloud-ulb/ucloud_ulb_test.go index e936db871..b7dc8cb64 100644 --- a/pkg/core/certmgr/providers/ucloud-ulb/ucloud_ulb_test.go +++ b/pkg/core/certmgr/providers-tester/ucloud-ulb/ucloud_ulb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ucloud-ulb" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("UCLOUDULB_") + fp = tester.InitArgs("UCLOUDULB_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ucloud-upathx/ucloud_upathx_test.go b/pkg/core/certmgr/providers-tester/ucloud-upathx/ucloud_upathx_test.go similarity index 81% rename from pkg/core/certmgr/providers/ucloud-upathx/ucloud_upathx_test.go rename to pkg/core/certmgr/providers-tester/ucloud-upathx/ucloud_upathx_test.go index 54acc18d6..14bfe7bc7 100644 --- a/pkg/core/certmgr/providers/ucloud-upathx/ucloud_upathx_test.go +++ b/pkg/core/certmgr/providers-tester/ucloud-upathx/ucloud_upathx_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ucloud-upathx" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("UCLOUDUPATHX_") + fp = tester.InitArgs("UCLOUDUPATHX_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/ucloud-ussl/ucloud_ussl_test.go b/pkg/core/certmgr/providers-tester/ucloud-ussl/ucloud_ussl_test.go similarity index 81% rename from pkg/core/certmgr/providers/ucloud-ussl/ucloud_ussl_test.go rename to pkg/core/certmgr/providers-tester/ucloud-ussl/ucloud_ussl_test.go index e98b66b1d..8d529b818 100644 --- a/pkg/core/certmgr/providers/ucloud-ussl/ucloud_ussl_test.go +++ b/pkg/core/certmgr/providers-tester/ucloud-ussl/ucloud_ussl_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ucloud-ussl" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("UCLOUDUSSL_") + fp = tester.InitArgs("UCLOUDUSSL_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/upyun-ssl/upyun_ssl_test.go b/pkg/core/certmgr/providers-tester/upyun-ssl/upyun_ssl_test.go similarity index 81% rename from pkg/core/certmgr/providers/upyun-ssl/upyun_ssl_test.go rename to pkg/core/certmgr/providers-tester/upyun-ssl/upyun_ssl_test.go index 0e74a066d..9301ba1fa 100644 --- a/pkg/core/certmgr/providers/upyun-ssl/upyun_ssl_test.go +++ b/pkg/core/certmgr/providers-tester/upyun-ssl/upyun_ssl_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/upyun-ssl" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("UPYUNSSL_") + fp = tester.InitArgs("UPYUNSSL_") fTestCertPath string fTestKeyPath string fUsername string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/volcengine-cdn/volcengine_cdn_test.go b/pkg/core/certmgr/providers-tester/volcengine-cdn/volcengine_cdn_test.go similarity index 82% rename from pkg/core/certmgr/providers/volcengine-cdn/volcengine_cdn_test.go rename to pkg/core/certmgr/providers-tester/volcengine-cdn/volcengine_cdn_test.go index cf6cf8225..97a434adf 100644 --- a/pkg/core/certmgr/providers/volcengine-cdn/volcengine_cdn_test.go +++ b/pkg/core/certmgr/providers-tester/volcengine-cdn/volcengine_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/volcengine-cdn" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("VOLCENGINECDN_") + fp = tester.InitArgs("VOLCENGINECDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/volcengine-certcenter/volcengine_certcenter_test.go b/pkg/core/certmgr/providers-tester/volcengine-certcenter/volcengine_certcenter_test.go similarity index 82% rename from pkg/core/certmgr/providers/volcengine-certcenter/volcengine_certcenter_test.go rename to pkg/core/certmgr/providers-tester/volcengine-certcenter/volcengine_certcenter_test.go index c661d7eab..35f5dc490 100644 --- a/pkg/core/certmgr/providers/volcengine-certcenter/volcengine_certcenter_test.go +++ b/pkg/core/certmgr/providers-tester/volcengine-certcenter/volcengine_certcenter_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/volcengine-certcenter" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("VOLCENGINECERTCENTER_") + fp = tester.InitArgs("VOLCENGINECERTCENTER_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/volcengine-live/volcengine_live_test.go b/pkg/core/certmgr/providers-tester/volcengine-live/volcengine_live_test.go similarity index 82% rename from pkg/core/certmgr/providers/volcengine-live/volcengine_live_test.go rename to pkg/core/certmgr/providers-tester/volcengine-live/volcengine_live_test.go index 32e9e89ad..c8c35df29 100644 --- a/pkg/core/certmgr/providers/volcengine-live/volcengine_live_test.go +++ b/pkg/core/certmgr/providers-tester/volcengine-live/volcengine_live_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/volcengine-live" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("VOLCENGINELIVE_") + fp = tester.InitArgs("VOLCENGINELIVE_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/wangsu-certificate/wangsu_certificate_test.go b/pkg/core/certmgr/providers-tester/wangsu-certificate/wangsu_certificate_test.go similarity index 82% rename from pkg/core/certmgr/providers/wangsu-certificate/wangsu_certificate_test.go rename to pkg/core/certmgr/providers-tester/wangsu-certificate/wangsu_certificate_test.go index 053fd96f7..cc994eaaf 100644 --- a/pkg/core/certmgr/providers/wangsu-certificate/wangsu_certificate_test.go +++ b/pkg/core/certmgr/providers-tester/wangsu-certificate/wangsu_certificate_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/wangsu-certificate" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("WANGSUCERTIFICATE_") + fp = tester.InitArgs("WANGSUCERTIFICATE_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go b/pkg/core/certmgr/providers-tester/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go similarity index 85% rename from pkg/core/certmgr/providers/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go rename to pkg/core/certmgr/providers-tester/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go index 7903a41ff..c8583e9ee 100644 --- a/pkg/core/certmgr/providers/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go +++ b/pkg/core/certmgr/providers-tester/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go @@ -6,12 +6,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/yandexcloud-certificatemanager" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("YANDEXCLOUDCERTIFICATEMANAGER_") + fp = tester.InitArgs("YANDEXCLOUDCERTIFICATEMANAGER_") fTestCertPath string fTestKeyPath string fFolderId string @@ -49,6 +49,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/zenlayer-cdn/zenlayer_cdn_test.go b/pkg/core/certmgr/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go similarity index 82% rename from pkg/core/certmgr/providers/zenlayer-cdn/zenlayer_cdn_test.go rename to pkg/core/certmgr/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go index 3b0f0d1f5..027916570 100644 --- a/pkg/core/certmgr/providers/zenlayer-cdn/zenlayer_cdn_test.go +++ b/pkg/core/certmgr/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/zenlayer-cdn" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("ZENLAYERCDN_") + fp = tester.InitArgs("ZENLAYERCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/providers/zenlayer-ga/zenlayer_ga_test.go b/pkg/core/certmgr/providers-tester/zenlayer-ga/zenlayer_ga_test.go similarity index 82% rename from pkg/core/certmgr/providers/zenlayer-ga/zenlayer_ga_test.go rename to pkg/core/certmgr/providers-tester/zenlayer-ga/zenlayer_ga_test.go index 392ada54b..b65455156 100644 --- a/pkg/core/certmgr/providers/zenlayer-ga/zenlayer_ga_test.go +++ b/pkg/core/certmgr/providers-tester/zenlayer-ga/zenlayer_ga_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/zenlayer-ga" - it "github.com/certimate-go/certimate/pkg/core/certmgr/testing" ) var ( - fp = it.Args("ZENLAYERGA_") + fp = tester.InitArgs("ZENLAYERGA_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/certmgr/testing/args.go b/pkg/core/certmgr/testing/args.go deleted file mode 100644 index 077fd3fa6..000000000 --- a/pkg/core/certmgr/testing/args.go +++ /dev/null @@ -1,9 +0,0 @@ -package testing - -import ( - "github.com/certimate-go/certimate/pkg/core/internal/testing" -) - -func Args(prefix string) testing.ArgsParser { - return testing.Args(prefix) -} diff --git a/pkg/core/deployer/providers/1panel-console/1panel_console_test.go b/pkg/core/deployer/providers-tester/1panel-console/1panel_console_test.go similarity index 84% rename from pkg/core/deployer/providers/1panel-console/1panel_console_test.go rename to pkg/core/deployer/providers-tester/1panel-console/1panel_console_test.go index 651ea4601..199a12efa 100644 --- a/pkg/core/deployer/providers/1panel-console/1panel_console_test.go +++ b/pkg/core/deployer/providers-tester/1panel-console/1panel_console_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/1panel-console" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("1PANELCONSOLE_") + fp = tester.InitArgs("1PANELCONSOLE_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -49,6 +49,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/1panel/1panel_test.go b/pkg/core/deployer/providers-tester/1panel/1panel_test.go similarity index 86% rename from pkg/core/deployer/providers/1panel/1panel_test.go rename to pkg/core/deployer/providers-tester/1panel/1panel_test.go index f91245264..eef81a942 100644 --- a/pkg/core/deployer/providers/1panel/1panel_test.go +++ b/pkg/core/deployer/providers-tester/1panel/1panel_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/1panel" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("1PANEL_") + fp = tester.InitArgs("1PANEL_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -57,7 +57,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToCertificate", func(t *testing.T) { @@ -71,6 +71,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-alb/aliyun_alb_test.go b/pkg/core/deployer/providers-tester/aliyun-alb/aliyun_alb_test.go similarity index 86% rename from pkg/core/deployer/providers/aliyun-alb/aliyun_alb_test.go rename to pkg/core/deployer/providers-tester/aliyun-alb/aliyun_alb_test.go index 3e9eb25d1..d29ffc7b2 100644 --- a/pkg/core/deployer/providers/aliyun-alb/aliyun_alb_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-alb/aliyun_alb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-alb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNALB_") + fp = tester.InitArgs("ALIYUNALB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -59,7 +59,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListener", func(t *testing.T) { @@ -73,6 +73,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-apigw/aliyun_apigw_test.go b/pkg/core/deployer/providers-tester/aliyun-apigw/aliyun_apigw_test.go similarity index 88% rename from pkg/core/deployer/providers/aliyun-apigw/aliyun_apigw_test.go rename to pkg/core/deployer/providers-tester/aliyun-apigw/aliyun_apigw_test.go index 6e1901daa..7d6ea9f0e 100644 --- a/pkg/core/deployer/providers/aliyun-apigw/aliyun_apigw_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-apigw/aliyun_apigw_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-apigw" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNAPIGW_") + fp = tester.InitArgs("ALIYUNAPIGW_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -64,6 +64,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn_test.go b/pkg/core/deployer/providers-tester/aliyun-cdn/aliyun_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn_test.go rename to pkg/core/deployer/providers-tester/aliyun-cdn/aliyun_cdn_test.go index eb5e96763..48b86549b 100644 --- a/pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-cdn/aliyun_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNCDN_") + fp = tester.InitArgs("ALIYUNCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-clb/aliyun_clb_test.go b/pkg/core/deployer/providers-tester/aliyun-clb/aliyun_clb_test.go similarity index 86% rename from pkg/core/deployer/providers/aliyun-clb/aliyun_clb_test.go rename to pkg/core/deployer/providers-tester/aliyun-clb/aliyun_clb_test.go index 696581ef0..7c7966b31 100644 --- a/pkg/core/deployer/providers/aliyun-clb/aliyun_clb_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-clb/aliyun_clb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-clb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNCLB_") + fp = tester.InitArgs("ALIYUNCLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -59,7 +59,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListener", func(t *testing.T) { @@ -74,6 +74,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-dcdn/aliyun_dcdn_test.go b/pkg/core/deployer/providers-tester/aliyun-dcdn/aliyun_dcdn_test.go similarity index 84% rename from pkg/core/deployer/providers/aliyun-dcdn/aliyun_dcdn_test.go rename to pkg/core/deployer/providers-tester/aliyun-dcdn/aliyun_dcdn_test.go index 0eae4fcac..710354346 100644 --- a/pkg/core/deployer/providers/aliyun-dcdn/aliyun_dcdn_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-dcdn/aliyun_dcdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-dcdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNDCDN_") + fp = tester.InitArgs("ALIYUNDCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-ddospro/aliyun_ddospro_test.go b/pkg/core/deployer/providers-tester/aliyun-ddospro/aliyun_ddospro_test.go similarity index 85% rename from pkg/core/deployer/providers/aliyun-ddospro/aliyun_ddospro_test.go rename to pkg/core/deployer/providers-tester/aliyun-ddospro/aliyun_ddospro_test.go index a18058490..c871c3713 100644 --- a/pkg/core/deployer/providers/aliyun-ddospro/aliyun_ddospro_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-ddospro/aliyun_ddospro_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-ddospro" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNDDOSPRO_") + fp = tester.InitArgs("ALIYUNDDOSPRO_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-esa-saas/aliyun_esasaas_test.go b/pkg/core/deployer/providers-tester/aliyun-esa-saas/aliyun_esasaas_test.go similarity index 86% rename from pkg/core/deployer/providers/aliyun-esa-saas/aliyun_esasaas_test.go rename to pkg/core/deployer/providers-tester/aliyun-esa-saas/aliyun_esasaas_test.go index abf4ba7bb..7db56008e 100644 --- a/pkg/core/deployer/providers/aliyun-esa-saas/aliyun_esasaas_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-esa-saas/aliyun_esasaas_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-esa-saas" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNESASAAS_") + fp = tester.InitArgs("ALIYUNESASAAS_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -56,6 +56,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-esa/aliyun_esa_test.go b/pkg/core/deployer/providers-tester/aliyun-esa/aliyun_esa_test.go similarity index 85% rename from pkg/core/deployer/providers/aliyun-esa/aliyun_esa_test.go rename to pkg/core/deployer/providers-tester/aliyun-esa/aliyun_esa_test.go index 618bf8748..c2b4d4041 100644 --- a/pkg/core/deployer/providers/aliyun-esa/aliyun_esa_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-esa/aliyun_esa_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-esa" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNESA_") + fp = tester.InitArgs("ALIYUNESA_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -51,6 +51,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-fc/aliyun_fc_test.go b/pkg/core/deployer/providers-tester/aliyun-fc/aliyun_fc_test.go similarity index 86% rename from pkg/core/deployer/providers/aliyun-fc/aliyun_fc_test.go rename to pkg/core/deployer/providers-tester/aliyun-fc/aliyun_fc_test.go index cbd477662..2f022f040 100644 --- a/pkg/core/deployer/providers/aliyun-fc/aliyun_fc_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-fc/aliyun_fc_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-fc" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNFC_") + fp = tester.InitArgs("ALIYUNFC_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -53,6 +53,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-ga/aliyun_ga_test.go b/pkg/core/deployer/providers-tester/aliyun-ga/aliyun_ga_test.go similarity index 85% rename from pkg/core/deployer/providers/aliyun-ga/aliyun_ga_test.go rename to pkg/core/deployer/providers-tester/aliyun-ga/aliyun_ga_test.go index a1e9f1a22..6dc3be170 100644 --- a/pkg/core/deployer/providers/aliyun-ga/aliyun_ga_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-ga/aliyun_ga_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-ga" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNGA_") + fp = tester.InitArgs("ALIYUNGA_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,7 +55,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListener", func(t *testing.T) { @@ -68,6 +68,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-live/aliyun_live_test.go b/pkg/core/deployer/providers-tester/aliyun-live/aliyun_live_test.go similarity index 85% rename from pkg/core/deployer/providers/aliyun-live/aliyun_live_test.go rename to pkg/core/deployer/providers-tester/aliyun-live/aliyun_live_test.go index c159a7c32..494f070e1 100644 --- a/pkg/core/deployer/providers/aliyun-live/aliyun_live_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-live/aliyun_live_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-live" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNLIVE_") + fp = tester.InitArgs("ALIYUNLIVE_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-nlb/aliyun_nlb_test.go b/pkg/core/deployer/providers-tester/aliyun-nlb/aliyun_nlb_test.go similarity index 85% rename from pkg/core/deployer/providers/aliyun-nlb/aliyun_nlb_test.go rename to pkg/core/deployer/providers-tester/aliyun-nlb/aliyun_nlb_test.go index 2f68d6405..baa401edb 100644 --- a/pkg/core/deployer/providers/aliyun-nlb/aliyun_nlb_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-nlb/aliyun_nlb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-nlb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNNLB_") + fp = tester.InitArgs("ALIYUNNLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,7 +55,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListener", func(t *testing.T) { @@ -68,6 +68,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-oss/aliyun_oss_test.go b/pkg/core/deployer/providers-tester/aliyun-oss/aliyun_oss_test.go similarity index 86% rename from pkg/core/deployer/providers/aliyun-oss/aliyun_oss_test.go rename to pkg/core/deployer/providers-tester/aliyun-oss/aliyun_oss_test.go index 8e886ef96..4f7c00691 100644 --- a/pkg/core/deployer/providers/aliyun-oss/aliyun_oss_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-oss/aliyun_oss_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-oss" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNOSS_") + fp = tester.InitArgs("ALIYUNOSS_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-vod/aliyun_vod_test.go b/pkg/core/deployer/providers-tester/aliyun-vod/aliyun_vod_test.go similarity index 85% rename from pkg/core/deployer/providers/aliyun-vod/aliyun_vod_test.go rename to pkg/core/deployer/providers-tester/aliyun-vod/aliyun_vod_test.go index f37197a90..ce9f78f19 100644 --- a/pkg/core/deployer/providers/aliyun-vod/aliyun_vod_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-vod/aliyun_vod_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-vod" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNVOD_") + fp = tester.InitArgs("ALIYUNVOD_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aliyun-waf/aliyun_waf_test.go b/pkg/core/deployer/providers-tester/aliyun-waf/aliyun_waf_test.go similarity index 85% rename from pkg/core/deployer/providers/aliyun-waf/aliyun_waf_test.go rename to pkg/core/deployer/providers-tester/aliyun-waf/aliyun_waf_test.go index 56e655091..476df2402 100644 --- a/pkg/core/deployer/providers/aliyun-waf/aliyun_waf_test.go +++ b/pkg/core/deployer/providers-tester/aliyun-waf/aliyun_waf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-waf" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ALIYUNWAF_") + fp = tester.InitArgs("ALIYUNWAF_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -51,6 +51,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/apisix/apisix_test.go b/pkg/core/deployer/providers-tester/apisix/apisix_test.go similarity index 84% rename from pkg/core/deployer/providers/apisix/apisix_test.go rename to pkg/core/deployer/providers-tester/apisix/apisix_test.go index 61d14d103..bea192204 100644 --- a/pkg/core/deployer/providers/apisix/apisix_test.go +++ b/pkg/core/deployer/providers-tester/apisix/apisix_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/apisix" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("APISIX_") + fp = tester.InitArgs("APISIX_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -49,6 +49,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aws-alb/aws_alb_test.go b/pkg/core/deployer/providers-tester/aws-alb/aws_alb_test.go similarity index 87% rename from pkg/core/deployer/providers/aws-alb/aws_alb_test.go rename to pkg/core/deployer/providers-tester/aws-alb/aws_alb_test.go index d5ca6b1ed..7ca45564c 100644 --- a/pkg/core/deployer/providers/aws-alb/aws_alb_test.go +++ b/pkg/core/deployer/providers-tester/aws-alb/aws_alb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-alb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("AWSALB_") + fp = tester.InitArgs("AWSALB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -56,6 +56,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aws-amplify/aws_amplify_test.go b/pkg/core/deployer/providers-tester/aws-amplify/aws_amplify_test.go similarity index 86% rename from pkg/core/deployer/providers/aws-amplify/aws_amplify_test.go rename to pkg/core/deployer/providers-tester/aws-amplify/aws_amplify_test.go index b8f461bdb..38f5dcdc5 100644 --- a/pkg/core/deployer/providers/aws-amplify/aws_amplify_test.go +++ b/pkg/core/deployer/providers-tester/aws-amplify/aws_amplify_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-amplify" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("AWSAMPLIFY_") + fp = tester.InitArgs("AWSAMPLIFY_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aws-apigateway/aws_apigateway_test.go b/pkg/core/deployer/providers-tester/aws-apigateway/aws_apigateway_test.go similarity index 85% rename from pkg/core/deployer/providers/aws-apigateway/aws_apigateway_test.go rename to pkg/core/deployer/providers-tester/aws-apigateway/aws_apigateway_test.go index 8b483a981..901d40f8c 100644 --- a/pkg/core/deployer/providers/aws-apigateway/aws_apigateway_test.go +++ b/pkg/core/deployer/providers-tester/aws-apigateway/aws_apigateway_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-apigateway" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("AWSAPIGATEWAY_") + fp = tester.InitArgs("AWSAPIGATEWAY_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aws-clb/aws_clb_test.go b/pkg/core/deployer/providers-tester/aws-clb/aws_clb_test.go similarity index 87% rename from pkg/core/deployer/providers/aws-clb/aws_clb_test.go rename to pkg/core/deployer/providers-tester/aws-clb/aws_clb_test.go index 44957cf3e..5ee509172 100644 --- a/pkg/core/deployer/providers/aws-clb/aws_clb_test.go +++ b/pkg/core/deployer/providers-tester/aws-clb/aws_clb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-clb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("AWSCLB_") + fp = tester.InitArgs("AWSCLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -56,6 +56,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aws-cloudfront/aws_cloudfront_test.go b/pkg/core/deployer/providers-tester/aws-cloudfront/aws_cloudfront_test.go similarity index 86% rename from pkg/core/deployer/providers/aws-cloudfront/aws_cloudfront_test.go rename to pkg/core/deployer/providers-tester/aws-cloudfront/aws_cloudfront_test.go index 7fa8ca992..f38f3e581 100644 --- a/pkg/core/deployer/providers/aws-cloudfront/aws_cloudfront_test.go +++ b/pkg/core/deployer/providers-tester/aws-cloudfront/aws_cloudfront_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-cloudfront" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("AWSCLOUDFRONT_") + fp = tester.InitArgs("AWSCLOUDFRONT_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/aws-nlb/aws_nlb_test.go b/pkg/core/deployer/providers-tester/aws-nlb/aws_nlb_test.go similarity index 87% rename from pkg/core/deployer/providers/aws-nlb/aws_nlb_test.go rename to pkg/core/deployer/providers-tester/aws-nlb/aws_nlb_test.go index 624ecc8ca..fb5284ec6 100644 --- a/pkg/core/deployer/providers/aws-nlb/aws_nlb_test.go +++ b/pkg/core/deployer/providers-tester/aws-nlb/aws_nlb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-nlb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("AWSNLB_") + fp = tester.InitArgs("AWSNLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -56,6 +56,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baiducloud-appblb/baiducloud_appblb_test.go b/pkg/core/deployer/providers-tester/baiducloud-appblb/baiducloud_appblb_test.go similarity index 87% rename from pkg/core/deployer/providers/baiducloud-appblb/baiducloud_appblb_test.go rename to pkg/core/deployer/providers-tester/baiducloud-appblb/baiducloud_appblb_test.go index 559d5d36d..271a2d2f1 100644 --- a/pkg/core/deployer/providers/baiducloud-appblb/baiducloud_appblb_test.go +++ b/pkg/core/deployer/providers-tester/baiducloud-appblb/baiducloud_appblb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baiducloud-appblb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAIDUCLOUDAPPBLB_") + fp = tester.InitArgs("BAIDUCLOUDAPPBLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -56,6 +56,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baiducloud-blb/baiducloud_blb_test.go b/pkg/core/deployer/providers-tester/baiducloud-blb/baiducloud_blb_test.go similarity index 87% rename from pkg/core/deployer/providers/baiducloud-blb/baiducloud_blb_test.go rename to pkg/core/deployer/providers-tester/baiducloud-blb/baiducloud_blb_test.go index 3e6ee519a..cb99efaac 100644 --- a/pkg/core/deployer/providers/baiducloud-blb/baiducloud_blb_test.go +++ b/pkg/core/deployer/providers-tester/baiducloud-blb/baiducloud_blb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baiducloud-blb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAIDUCLOUDBLB_") + fp = tester.InitArgs("BAIDUCLOUDBLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -56,6 +56,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baiducloud-cdn/baiducloud_cdn_test.go b/pkg/core/deployer/providers-tester/baiducloud-cdn/baiducloud_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/baiducloud-cdn/baiducloud_cdn_test.go rename to pkg/core/deployer/providers-tester/baiducloud-cdn/baiducloud_cdn_test.go index 015913726..7a4d8196e 100644 --- a/pkg/core/deployer/providers/baiducloud-cdn/baiducloud_cdn_test.go +++ b/pkg/core/deployer/providers-tester/baiducloud-cdn/baiducloud_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baiducloud-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAIDUCLOUDCDN_") + fp = tester.InitArgs("BAIDUCLOUDCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baishan-cdn/baishan_cdn_test.go b/pkg/core/deployer/providers-tester/baishan-cdn/baishan_cdn_test.go similarity index 82% rename from pkg/core/deployer/providers/baishan-cdn/baishan_cdn_test.go rename to pkg/core/deployer/providers-tester/baishan-cdn/baishan_cdn_test.go index a70832054..5648cad1a 100644 --- a/pkg/core/deployer/providers/baishan-cdn/baishan_cdn_test.go +++ b/pkg/core/deployer/providers-tester/baishan-cdn/baishan_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baishan-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAISHANCDN_") + fp = tester.InitArgs("BAISHANCDN_") fTestCertPath string fTestKeyPath string fApiToken string @@ -44,6 +44,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baotapanel-console/baotapanel_console_test.go b/pkg/core/deployer/providers-tester/baotapanel-console/baotapanel_console_test.go similarity index 82% rename from pkg/core/deployer/providers/baotapanel-console/baotapanel_console_test.go rename to pkg/core/deployer/providers-tester/baotapanel-console/baotapanel_console_test.go index 4f7113b88..14c22b704 100644 --- a/pkg/core/deployer/providers/baotapanel-console/baotapanel_console_test.go +++ b/pkg/core/deployer/providers-tester/baotapanel-console/baotapanel_console_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotapanel-console" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAOTAPANELCONSOLE_") + fp = tester.InitArgs("BAOTAPANELCONSOLE_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -45,6 +45,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baotapanel/baotapanel_test.go b/pkg/core/deployer/providers-tester/baotapanel/baotapanel_test.go similarity index 85% rename from pkg/core/deployer/providers/baotapanel/baotapanel_test.go rename to pkg/core/deployer/providers-tester/baotapanel/baotapanel_test.go index 85b532636..161e4b292 100644 --- a/pkg/core/deployer/providers/baotapanel/baotapanel_test.go +++ b/pkg/core/deployer/providers-tester/baotapanel/baotapanel_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotapanel" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAOTAPANEL_") + fp = tester.InitArgs("BAOTAPANEL_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baotapanelgo-console/baotapanelgo_console_test.go b/pkg/core/deployer/providers-tester/baotapanelgo-console/baotapanelgo_console_test.go similarity index 82% rename from pkg/core/deployer/providers/baotapanelgo-console/baotapanelgo_console_test.go rename to pkg/core/deployer/providers-tester/baotapanelgo-console/baotapanelgo_console_test.go index a4fe3f6f8..d30e0ae7b 100644 --- a/pkg/core/deployer/providers/baotapanelgo-console/baotapanelgo_console_test.go +++ b/pkg/core/deployer/providers-tester/baotapanelgo-console/baotapanelgo_console_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotapanelgo-console" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAOTAPANELGOCONSOLE_") + fp = tester.InitArgs("BAOTAPANELGOCONSOLE_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -44,6 +44,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baotapanelgo/baotapanelgo_test.go b/pkg/core/deployer/providers-tester/baotapanelgo/baotapanelgo_test.go similarity index 85% rename from pkg/core/deployer/providers/baotapanelgo/baotapanelgo_test.go rename to pkg/core/deployer/providers-tester/baotapanelgo/baotapanelgo_test.go index 71912e0af..48f7b2faf 100644 --- a/pkg/core/deployer/providers/baotapanelgo/baotapanelgo_test.go +++ b/pkg/core/deployer/providers-tester/baotapanelgo/baotapanelgo_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotapanelgo" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAOTAPANELGO_") + fp = tester.InitArgs("BAOTAPANELGO_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baotawaf-console/baotawaf_console_test.go b/pkg/core/deployer/providers-tester/baotawaf-console/baotawaf_console_test.go similarity index 83% rename from pkg/core/deployer/providers/baotawaf-console/baotawaf_console_test.go rename to pkg/core/deployer/providers-tester/baotawaf-console/baotawaf_console_test.go index 39590f116..28cb673b0 100644 --- a/pkg/core/deployer/providers/baotawaf-console/baotawaf_console_test.go +++ b/pkg/core/deployer/providers-tester/baotawaf-console/baotawaf_console_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotawaf-console" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAOTAWAFCONSOLE_") + fp = tester.InitArgs("BAOTAWAFCONSOLE_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -46,6 +46,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/baotawaf/baotawaf_test.go b/pkg/core/deployer/providers-tester/baotawaf/baotawaf_test.go similarity index 85% rename from pkg/core/deployer/providers/baotawaf/baotawaf_test.go rename to pkg/core/deployer/providers-tester/baotawaf/baotawaf_test.go index ffbc985f0..c9f1182ea 100644 --- a/pkg/core/deployer/providers/baotawaf/baotawaf_test.go +++ b/pkg/core/deployer/providers-tester/baotawaf/baotawaf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotawaf" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BAOTAWAF_") + fp = tester.InitArgs("BAOTAWAF_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/bunny-cdn/bunny_cdn_test.go b/pkg/core/deployer/providers-tester/bunny-cdn/bunny_cdn_test.go similarity index 83% rename from pkg/core/deployer/providers/bunny-cdn/bunny_cdn_test.go rename to pkg/core/deployer/providers-tester/bunny-cdn/bunny_cdn_test.go index a3d6009ce..b17d6d228 100644 --- a/pkg/core/deployer/providers/bunny-cdn/bunny_cdn_test.go +++ b/pkg/core/deployer/providers-tester/bunny-cdn/bunny_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/bunny-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BUNNYCDN_") + fp = tester.InitArgs("BUNNYCDN_") fTestCertPath string fTestKeyPath string fApiKey string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/byteplus-alb/byteplus_alb_test.go b/pkg/core/deployer/providers-tester/byteplus-alb/byteplus_alb_test.go similarity index 85% rename from pkg/core/deployer/providers/byteplus-alb/byteplus_alb_test.go rename to pkg/core/deployer/providers-tester/byteplus-alb/byteplus_alb_test.go index a8b46c897..17b4dccca 100644 --- a/pkg/core/deployer/providers/byteplus-alb/byteplus_alb_test.go +++ b/pkg/core/deployer/providers-tester/byteplus-alb/byteplus_alb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-alb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BYTEPLUSALB_") + fp = tester.InitArgs("BYTEPLUSALB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/byteplus-apig/byteplus_apig_test.go b/pkg/core/deployer/providers-tester/byteplus-apig/byteplus_apig_test.go similarity index 85% rename from pkg/core/deployer/providers/byteplus-apig/byteplus_apig_test.go rename to pkg/core/deployer/providers-tester/byteplus-apig/byteplus_apig_test.go index 6e2f5d935..d5b1749f6 100644 --- a/pkg/core/deployer/providers/byteplus-apig/byteplus_apig_test.go +++ b/pkg/core/deployer/providers-tester/byteplus-apig/byteplus_apig_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-apig" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BYTEPLUSAPIG_") + fp = tester.InitArgs("BYTEPLUSAPIG_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/byteplus-cdn/byteplus_cdn_test.go b/pkg/core/deployer/providers-tester/byteplus-cdn/byteplus_cdn_test.go similarity index 83% rename from pkg/core/deployer/providers/byteplus-cdn/byteplus_cdn_test.go rename to pkg/core/deployer/providers-tester/byteplus-cdn/byteplus_cdn_test.go index f6b830819..94fd104ec 100644 --- a/pkg/core/deployer/providers/byteplus-cdn/byteplus_cdn_test.go +++ b/pkg/core/deployer/providers-tester/byteplus-cdn/byteplus_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BYTEPLUSCDN_") + fp = tester.InitArgs("BYTEPLUSCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/byteplus-clb/byteplus_clb_test.go b/pkg/core/deployer/providers-tester/byteplus-clb/byteplus_clb_test.go similarity index 85% rename from pkg/core/deployer/providers/byteplus-clb/byteplus_clb_test.go rename to pkg/core/deployer/providers-tester/byteplus-clb/byteplus_clb_test.go index 286d34367..50648032d 100644 --- a/pkg/core/deployer/providers/byteplus-clb/byteplus_clb_test.go +++ b/pkg/core/deployer/providers-tester/byteplus-clb/byteplus_clb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-clb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BYTEPLUSCLB_") + fp = tester.InitArgs("BYTEPLUSCLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/byteplus-medialive/byteplus_medialive_test.go b/pkg/core/deployer/providers-tester/byteplus-medialive/byteplus_medialive_test.go similarity index 84% rename from pkg/core/deployer/providers/byteplus-medialive/byteplus_medialive_test.go rename to pkg/core/deployer/providers-tester/byteplus-medialive/byteplus_medialive_test.go index 8bc12abcb..372840b5f 100644 --- a/pkg/core/deployer/providers/byteplus-medialive/byteplus_medialive_test.go +++ b/pkg/core/deployer/providers-tester/byteplus-medialive/byteplus_medialive_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-medialive" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BYTEPLUSMEDIALIVE_") + fp = tester.InitArgs("BYTEPLUSMEDIALIVE_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/byteplus-tos/byteplus_tos_test.go b/pkg/core/deployer/providers-tester/byteplus-tos/byteplus_tos_test.go similarity index 86% rename from pkg/core/deployer/providers/byteplus-tos/byteplus_tos_test.go rename to pkg/core/deployer/providers-tester/byteplus-tos/byteplus_tos_test.go index 9a2b8e2a4..4164332e7 100644 --- a/pkg/core/deployer/providers/byteplus-tos/byteplus_tos_test.go +++ b/pkg/core/deployer/providers-tester/byteplus-tos/byteplus_tos_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-tos" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("BYTEPLUSTOS_") + fp = tester.InitArgs("BYTEPLUSTOS_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/cachefly/cachefly_test.go b/pkg/core/deployer/providers-tester/cachefly/cachefly_test.go similarity index 78% rename from pkg/core/deployer/providers/cachefly/cachefly_test.go rename to pkg/core/deployer/providers-tester/cachefly/cachefly_test.go index 8a5e7e2f5..e91c7e7d0 100644 --- a/pkg/core/deployer/providers/cachefly/cachefly_test.go +++ b/pkg/core/deployer/providers-tester/cachefly/cachefly_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cachefly" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CACHEFLY_") + fp = tester.InitArgs("CACHEFLY_") fTestCertPath string fTestKeyPath string fApiToken string @@ -39,6 +39,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/cdnfly/cdnfly_test.go b/pkg/core/deployer/providers-tester/cdnfly/cdnfly_test.go similarity index 86% rename from pkg/core/deployer/providers/cdnfly/cdnfly_test.go rename to pkg/core/deployer/providers-tester/cdnfly/cdnfly_test.go index 6e30a861c..95eb80635 100644 --- a/pkg/core/deployer/providers/cdnfly/cdnfly_test.go +++ b/pkg/core/deployer/providers-tester/cdnfly/cdnfly_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cdnfly" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CDNFLY_") + fp = tester.InitArgs("CDNFLY_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -53,6 +53,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/cloudflare-ssl/cloudflare_ssl_test.go b/pkg/core/deployer/providers-tester/cloudflare-ssl/cloudflare_ssl_test.go similarity index 83% rename from pkg/core/deployer/providers/cloudflare-ssl/cloudflare_ssl_test.go rename to pkg/core/deployer/providers-tester/cloudflare-ssl/cloudflare_ssl_test.go index 24edd8f1c..d48ab53e3 100644 --- a/pkg/core/deployer/providers/cloudflare-ssl/cloudflare_ssl_test.go +++ b/pkg/core/deployer/providers-tester/cloudflare-ssl/cloudflare_ssl_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cloudflare-ssl" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CLOUDFLARESSL_") + fp = tester.InitArgs("CLOUDFLARESSL_") fTestCertPath string fTestKeyPath string fApiToken string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn_test.go b/pkg/core/deployer/providers-tester/cmcccloud-cdn/cmcccloud_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn_test.go rename to pkg/core/deployer/providers-tester/cmcccloud-cdn/cmcccloud_cdn_test.go index 2e4eedbdc..4528d258f 100644 --- a/pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn_test.go +++ b/pkg/core/deployer/providers-tester/cmcccloud-cdn/cmcccloud_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cmcccloud-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CMCCCLOUDCDN_") + fp = tester.InitArgs("CMCCCLOUDCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb_test.go b/pkg/core/deployer/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go similarity index 85% rename from pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb_test.go rename to pkg/core/deployer/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go index 88d2148a2..f8ded6f21 100644 --- a/pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb_test.go +++ b/pkg/core/deployer/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cmcccloud-vlb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CMCCCLOUDVLB_") + fp = tester.InitArgs("CMCCCLOUDVLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,7 +55,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListener", func(t *testing.T) { @@ -68,6 +68,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/cpanel/cpanel_test.go b/pkg/core/deployer/providers-tester/cpanel/cpanel_test.go similarity index 86% rename from pkg/core/deployer/providers/cpanel/cpanel_test.go rename to pkg/core/deployer/providers-tester/cpanel/cpanel_test.go index 1ca12ab4f..90e65e1f8 100644 --- a/pkg/core/deployer/providers/cpanel/cpanel_test.go +++ b/pkg/core/deployer/providers-tester/cpanel/cpanel_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cpanel" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CPANEL_") + fp = tester.InitArgs("CPANEL_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -53,6 +53,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ctcccloud-ao/ctcccloud_ao_test.go b/pkg/core/deployer/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go similarity index 84% rename from pkg/core/deployer/providers/ctcccloud-ao/ctcccloud_ao_test.go rename to pkg/core/deployer/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go index b4e4760c4..a1eb74c81 100644 --- a/pkg/core/deployer/providers/ctcccloud-ao/ctcccloud_ao_test.go +++ b/pkg/core/deployer/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-ao" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CTCCCLOUDAO_") + fp = tester.InitArgs("CTCCCLOUDAO_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ctcccloud-cdn/ctcccloud_cdn_test.go b/pkg/core/deployer/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/ctcccloud-cdn/ctcccloud_cdn_test.go rename to pkg/core/deployer/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go index 4f36191a3..24d024479 100644 --- a/pkg/core/deployer/providers/ctcccloud-cdn/ctcccloud_cdn_test.go +++ b/pkg/core/deployer/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CTCCCLOUDCDN_") + fp = tester.InitArgs("CTCCCLOUDCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ctcccloud-cms/ctcccloud_cms_test.go b/pkg/core/deployer/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go similarity index 82% rename from pkg/core/deployer/providers/ctcccloud-cms/ctcccloud_cms_test.go rename to pkg/core/deployer/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go index 0d6e1d642..911352872 100644 --- a/pkg/core/deployer/providers/ctcccloud-cms/ctcccloud_cms_test.go +++ b/pkg/core/deployer/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-cms" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CTCCCLOUDCMS_") + fp = tester.InitArgs("CTCCCLOUDCMS_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ctcccloud-elb/ctcccloud_elb_test.go b/pkg/core/deployer/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go similarity index 85% rename from pkg/core/deployer/providers/ctcccloud-elb/ctcccloud_elb_test.go rename to pkg/core/deployer/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go index eea8851b5..6e830454e 100644 --- a/pkg/core/deployer/providers/ctcccloud-elb/ctcccloud_elb_test.go +++ b/pkg/core/deployer/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-elb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CTCCCLOUDELB_") + fp = tester.InitArgs("CTCCCLOUDELB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,7 +55,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListener", func(t *testing.T) { @@ -68,6 +68,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ctcccloud-faas/ctcccloud_faas_test.go b/pkg/core/deployer/providers-tester/ctcccloud-faas/ctcccloud_faas_test.go similarity index 85% rename from pkg/core/deployer/providers/ctcccloud-faas/ctcccloud_faas_test.go rename to pkg/core/deployer/providers-tester/ctcccloud-faas/ctcccloud_faas_test.go index efbafb738..cfa0a1a6f 100644 --- a/pkg/core/deployer/providers/ctcccloud-faas/ctcccloud_faas_test.go +++ b/pkg/core/deployer/providers-tester/ctcccloud-faas/ctcccloud_faas_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-faas" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CTCCCLOUDFAAS_") + fp = tester.InitArgs("CTCCCLOUDFAAS_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -51,6 +51,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ctcccloud-icdn/ctcccloud_icdn_test.go b/pkg/core/deployer/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go similarity index 84% rename from pkg/core/deployer/providers/ctcccloud-icdn/ctcccloud_icdn_test.go rename to pkg/core/deployer/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go index 17955e098..42887ad23 100644 --- a/pkg/core/deployer/providers/ctcccloud-icdn/ctcccloud_icdn_test.go +++ b/pkg/core/deployer/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-icdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CTCCCLOUDCDN_") + fp = tester.InitArgs("CTCCCLOUDCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go b/pkg/core/deployer/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go similarity index 84% rename from pkg/core/deployer/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go rename to pkg/core/deployer/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go index 0e6166334..5ef8517bc 100644 --- a/pkg/core/deployer/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go +++ b/pkg/core/deployer/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-lvdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("CTCCCLOUDLVDN_") + fp = tester.InitArgs("CTCCCLOUDLVDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/dogecloud-cdn/dogecloud_cdn_test.go b/pkg/core/deployer/providers-tester/dogecloud-cdn/dogecloud_cdn_test.go similarity index 83% rename from pkg/core/deployer/providers/dogecloud-cdn/dogecloud_cdn_test.go rename to pkg/core/deployer/providers-tester/dogecloud-cdn/dogecloud_cdn_test.go index c0bd7f283..7bb2345f6 100644 --- a/pkg/core/deployer/providers/dogecloud-cdn/dogecloud_cdn_test.go +++ b/pkg/core/deployer/providers-tester/dogecloud-cdn/dogecloud_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/dogecloud-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("DOGECLOUDCDN_") + fp = tester.InitArgs("DOGECLOUDCDN_") fTestCertPath string fTestKeyPath string fAccessKey string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/flexcdn/flexcdn_test.go b/pkg/core/deployer/providers-tester/flexcdn/flexcdn_test.go similarity index 86% rename from pkg/core/deployer/providers/flexcdn/flexcdn_test.go rename to pkg/core/deployer/providers-tester/flexcdn/flexcdn_test.go index 128cd10a7..84d8e5639 100644 --- a/pkg/core/deployer/providers/flexcdn/flexcdn_test.go +++ b/pkg/core/deployer/providers-tester/flexcdn/flexcdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/flexcdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("FLEXCDN_") + fp = tester.InitArgs("FLEXCDN_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -54,6 +54,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/flyio/flyio_test.go b/pkg/core/deployer/providers-tester/flyio/flyio_test.go similarity index 82% rename from pkg/core/deployer/providers/flyio/flyio_test.go rename to pkg/core/deployer/providers-tester/flyio/flyio_test.go index c22f7cb73..2620c3fe1 100644 --- a/pkg/core/deployer/providers/flyio/flyio_test.go +++ b/pkg/core/deployer/providers-tester/flyio/flyio_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/flyio" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("FLYIO_") + fp = tester.InitArgs("FLYIO_") fTestCertPath string fTestKeyPath string fApiToken string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ftp/ftp_test.go b/pkg/core/deployer/providers-tester/ftp/ftp_test.go similarity index 87% rename from pkg/core/deployer/providers/ftp/ftp_test.go rename to pkg/core/deployer/providers-tester/ftp/ftp_test.go index db0c8273b..c4b7437ed 100644 --- a/pkg/core/deployer/providers/ftp/ftp_test.go +++ b/pkg/core/deployer/providers-tester/ftp/ftp_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ftp" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("FTP_") + fp = tester.InitArgs("FTP_") fTestCertPath string fTestKeyPath string fFtpHost string @@ -60,6 +60,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/gcore-cdn/gcore_cdn_test.go b/pkg/core/deployer/providers-tester/gcore-cdn/gcore_cdn_test.go similarity index 81% rename from pkg/core/deployer/providers/gcore-cdn/gcore_cdn_test.go rename to pkg/core/deployer/providers-tester/gcore-cdn/gcore_cdn_test.go index 4c114296a..a1337570a 100644 --- a/pkg/core/deployer/providers/gcore-cdn/gcore_cdn_test.go +++ b/pkg/core/deployer/providers-tester/gcore-cdn/gcore_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/gcore-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("GCORECDN_") + fp = tester.InitArgs("GCORECDN_") fTestCertPath string fTestKeyPath string fApiToken string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/goedge/goedge_test.go b/pkg/core/deployer/providers-tester/goedge/goedge_test.go similarity index 86% rename from pkg/core/deployer/providers/goedge/goedge_test.go rename to pkg/core/deployer/providers-tester/goedge/goedge_test.go index 65c34ff85..0af7fced8 100644 --- a/pkg/core/deployer/providers/goedge/goedge_test.go +++ b/pkg/core/deployer/providers-tester/goedge/goedge_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/goedge" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("GOEDGE_") + fp = tester.InitArgs("GOEDGE_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -54,6 +54,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/huaweicloud-aad/huaweicloud_aad_test.go b/pkg/core/deployer/providers-tester/huaweicloud-aad/huaweicloud_aad_test.go similarity index 86% rename from pkg/core/deployer/providers/huaweicloud-aad/huaweicloud_aad_test.go rename to pkg/core/deployer/providers-tester/huaweicloud-aad/huaweicloud_aad_test.go index 32936f96c..f04aa29db 100644 --- a/pkg/core/deployer/providers/huaweicloud-aad/huaweicloud_aad_test.go +++ b/pkg/core/deployer/providers-tester/huaweicloud-aad/huaweicloud_aad_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-aad" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("HUAWEICLOUDAAD_") + fp = tester.InitArgs("HUAWEICLOUDAAD_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/huaweicloud-apig/huaweicloud_apig_test.go b/pkg/core/deployer/providers-tester/huaweicloud-apig/huaweicloud_apig_test.go similarity index 86% rename from pkg/core/deployer/providers/huaweicloud-apig/huaweicloud_apig_test.go rename to pkg/core/deployer/providers-tester/huaweicloud-apig/huaweicloud_apig_test.go index 3cf151190..2c0f08437 100644 --- a/pkg/core/deployer/providers/huaweicloud-apig/huaweicloud_apig_test.go +++ b/pkg/core/deployer/providers-tester/huaweicloud-apig/huaweicloud_apig_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-apig" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("HUAWEICLOUDAPIG_") + fp = tester.InitArgs("HUAWEICLOUDAPIG_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn_test.go b/pkg/core/deployer/providers-tester/huaweicloud-cdn/huaweicloud_cdn_test.go similarity index 85% rename from pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn_test.go rename to pkg/core/deployer/providers-tester/huaweicloud-cdn/huaweicloud_cdn_test.go index 61b48373a..dcff896b5 100644 --- a/pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn_test.go +++ b/pkg/core/deployer/providers-tester/huaweicloud-cdn/huaweicloud_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("HUAWEICLOUDCDN_") + fp = tester.InitArgs("HUAWEICLOUDCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/huaweicloud-elb/huaweicloud_elb_test.go b/pkg/core/deployer/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go similarity index 84% rename from pkg/core/deployer/providers/huaweicloud-elb/huaweicloud_elb_test.go rename to pkg/core/deployer/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go index 3091213d7..36b6039df 100644 --- a/pkg/core/deployer/providers/huaweicloud-elb/huaweicloud_elb_test.go +++ b/pkg/core/deployer/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-elb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("HUAWEICLOUDELB_") + fp = tester.InitArgs("HUAWEICLOUDELB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -58,7 +58,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListenerId", func(t *testing.T) { @@ -71,7 +71,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToCertificate", func(t *testing.T) { @@ -84,6 +84,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/huaweicloud-live/huaweicloud_live_test.go b/pkg/core/deployer/providers-tester/huaweicloud-live/huaweicloud_live_test.go similarity index 85% rename from pkg/core/deployer/providers/huaweicloud-live/huaweicloud_live_test.go rename to pkg/core/deployer/providers-tester/huaweicloud-live/huaweicloud_live_test.go index 8b21aa283..253e0014d 100644 --- a/pkg/core/deployer/providers/huaweicloud-live/huaweicloud_live_test.go +++ b/pkg/core/deployer/providers-tester/huaweicloud-live/huaweicloud_live_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-live" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("HUAWEICLOUDLIVE_") + fp = tester.InitArgs("HUAWEICLOUDLIVE_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/huaweicloud-obs/huaweicloud_obs_test.go b/pkg/core/deployer/providers-tester/huaweicloud-obs/huaweicloud_obs_test.go similarity index 86% rename from pkg/core/deployer/providers/huaweicloud-obs/huaweicloud_obs_test.go rename to pkg/core/deployer/providers-tester/huaweicloud-obs/huaweicloud_obs_test.go index 67f87ffa7..a738acc73 100644 --- a/pkg/core/deployer/providers/huaweicloud-obs/huaweicloud_obs_test.go +++ b/pkg/core/deployer/providers-tester/huaweicloud-obs/huaweicloud_obs_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-obs" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("HUAWEICLOUDOBS_") + fp = tester.InitArgs("HUAWEICLOUDOBS_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/huaweicloud-vod/huaweicloud_vod_test.go b/pkg/core/deployer/providers-tester/huaweicloud-vod/huaweicloud_vod_test.go similarity index 85% rename from pkg/core/deployer/providers/huaweicloud-vod/huaweicloud_vod_test.go rename to pkg/core/deployer/providers-tester/huaweicloud-vod/huaweicloud_vod_test.go index 6aa71e676..d6aa5e597 100644 --- a/pkg/core/deployer/providers/huaweicloud-vod/huaweicloud_vod_test.go +++ b/pkg/core/deployer/providers-tester/huaweicloud-vod/huaweicloud_vod_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-vod" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("HUAWEICLOUDVOD_") + fp = tester.InitArgs("HUAWEICLOUDVOD_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/huaweicloud-waf/huaweicloud_waf_test.go b/pkg/core/deployer/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go similarity index 85% rename from pkg/core/deployer/providers/huaweicloud-waf/huaweicloud_waf_test.go rename to pkg/core/deployer/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go index d7a666b6f..272a95115 100644 --- a/pkg/core/deployer/providers/huaweicloud-waf/huaweicloud_waf_test.go +++ b/pkg/core/deployer/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-waf" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("HUAWEICLOUDWAF_") + fp = tester.InitArgs("HUAWEICLOUDWAF_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/huaweiibmc/huaweiibmc_test.go b/pkg/core/deployer/providers-tester/huaweiibmc/huaweiibmc_test.go similarity index 82% rename from pkg/core/deployer/providers/huaweiibmc/huaweiibmc_test.go rename to pkg/core/deployer/providers-tester/huaweiibmc/huaweiibmc_test.go index bb8c81875..296277da0 100644 --- a/pkg/core/deployer/providers/huaweiibmc/huaweiibmc_test.go +++ b/pkg/core/deployer/providers-tester/huaweiibmc/huaweiibmc_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweiibmc" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("HUAWEIIBMC_") + fp = tester.InitArgs("HUAWEIIBMC_") fTestCertPath string fTestKeyPath string fHost string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/jdcloud-alb/jdcloud_alb_test.go b/pkg/core/deployer/providers-tester/jdcloud-alb/jdcloud_alb_test.go similarity index 85% rename from pkg/core/deployer/providers/jdcloud-alb/jdcloud_alb_test.go rename to pkg/core/deployer/providers-tester/jdcloud-alb/jdcloud_alb_test.go index dac86be63..e593cc779 100644 --- a/pkg/core/deployer/providers/jdcloud-alb/jdcloud_alb_test.go +++ b/pkg/core/deployer/providers-tester/jdcloud-alb/jdcloud_alb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-alb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("JDCLOUDALB_") + fp = tester.InitArgs("JDCLOUDALB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,7 +55,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListener", func(t *testing.T) { @@ -68,6 +68,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/jdcloud-cdn/jdcloud_cdn_test.go b/pkg/core/deployer/providers-tester/jdcloud-cdn/jdcloud_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/jdcloud-cdn/jdcloud_cdn_test.go rename to pkg/core/deployer/providers-tester/jdcloud-cdn/jdcloud_cdn_test.go index 014018d5d..2a09563fe 100644 --- a/pkg/core/deployer/providers/jdcloud-cdn/jdcloud_cdn_test.go +++ b/pkg/core/deployer/providers-tester/jdcloud-cdn/jdcloud_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("JDCLOUDCDN_") + fp = tester.InitArgs("JDCLOUDCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/jdcloud-live/jdcloud_live_test.go b/pkg/core/deployer/providers-tester/jdcloud-live/jdcloud_live_test.go similarity index 84% rename from pkg/core/deployer/providers/jdcloud-live/jdcloud_live_test.go rename to pkg/core/deployer/providers-tester/jdcloud-live/jdcloud_live_test.go index 4a79c665a..0905c0b8e 100644 --- a/pkg/core/deployer/providers/jdcloud-live/jdcloud_live_test.go +++ b/pkg/core/deployer/providers-tester/jdcloud-live/jdcloud_live_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-live" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("JDCLOUDLIVE_") + fp = tester.InitArgs("JDCLOUDLIVE_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/jdcloud-vod/jdcloud_vod_test.go b/pkg/core/deployer/providers-tester/jdcloud-vod/jdcloud_vod_test.go similarity index 84% rename from pkg/core/deployer/providers/jdcloud-vod/jdcloud_vod_test.go rename to pkg/core/deployer/providers-tester/jdcloud-vod/jdcloud_vod_test.go index 952bc89cf..0fa0cb768 100644 --- a/pkg/core/deployer/providers/jdcloud-vod/jdcloud_vod_test.go +++ b/pkg/core/deployer/providers-tester/jdcloud-vod/jdcloud_vod_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-vod" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("JDCLOUDVOD_") + fp = tester.InitArgs("JDCLOUDVOD_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/jdcloud-waf/jdcloud_waf_test.go b/pkg/core/deployer/providers-tester/jdcloud-waf/jdcloud_waf_test.go similarity index 85% rename from pkg/core/deployer/providers/jdcloud-waf/jdcloud_waf_test.go rename to pkg/core/deployer/providers-tester/jdcloud-waf/jdcloud_waf_test.go index 743ca880d..03cd21e27 100644 --- a/pkg/core/deployer/providers/jdcloud-waf/jdcloud_waf_test.go +++ b/pkg/core/deployer/providers-tester/jdcloud-waf/jdcloud_waf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-waf" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("JDCLOUDWAF_") + fp = tester.InitArgs("JDCLOUDWAF_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -51,6 +51,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers-tester/k8s-secret/k8s_secret_test.go b/pkg/core/deployer/providers-tester/k8s-secret/k8s_secret_test.go new file mode 100644 index 000000000..7b8b9f100 --- /dev/null +++ b/pkg/core/deployer/providers-tester/k8s-secret/k8s_secret_test.go @@ -0,0 +1,66 @@ +package k8ssecret_test + +import ( + "os" + "testing" + + "github.com/stretchr/testify/require" + + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" + impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/k8s-secret" +) + +var ( + fp = tester.InitArgs("K8SSECRET_") + fTestCertPath string + fTestKeyPath string + fKubeConfig string + fNamespace string + fSecretName string + fSecretDataKeyForCrt string + fSecretDataKeyForKey string +) + +func init() { + fp.DefineString(&fTestCertPath, "TESTCERTPATH") + fp.DefineString(&fTestKeyPath, "TESTKEYPATH") + fp.DefineString(&fKubeConfig, "KUBECONFIG") + fp.DefineString(&fNamespace, "NAMESPACE", "default") + fp.DefineString(&fSecretName, "SECRETNAME") + fp.DefineString(&fSecretDataKeyForCrt, "SECRETDATAKEYFORCRT", "tls.crt") + fp.DefineString(&fSecretDataKeyForKey, "SECRETDATAKEYFORKEY", "tls.key") +} + +/* +Shell command to run this test: + + go test -v ./k8s_secret_test.go -args \ + --K8SSECRET_TESTCERTPATH="/path/to/your-test-cert.pem" \ + --K8SSECRET_TESTKEYPATH="/path/to/your-test-key.pem" \ + --K8SSECRET_KUBECONFIG="..." \ + --K8SSECRET_NAMESPACE="default" \ + --K8SSECRET_SECRETNAME="secret" \ + --K8SSECRET_SECRETDATAKEYFORCRT="tls.crt" \ + --K8SSECRET_SECRETDATAKEYFORKEY="tls.key" +*/ +func TestProvider(t *testing.T) { + fp.Parse() + + if fKubeConfigStat, err := os.Stat(fKubeConfig); err == nil && !fKubeConfigStat.IsDir() { + fKubeConfigBytes, _ := os.ReadFile(fKubeConfig) + fKubeConfig = string(fKubeConfigBytes) + } + + t.Run("Deploy", func(t *testing.T) { + provider, err := impl.NewDeployer(&impl.DeployerConfig{ + KubeConfig: fKubeConfig, + Namespace: fNamespace, + SecretName: fSecretName, + SecretDataKeyForCrt: fSecretDataKeyForCrt, + SecretDataKeyForKey: fSecretDataKeyForKey, + }) + require.NoError(t, err) + + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + }) +} diff --git a/pkg/core/deployer/providers/kong/kong_test.go b/pkg/core/deployer/providers-tester/kong/kong_test.go similarity index 84% rename from pkg/core/deployer/providers/kong/kong_test.go rename to pkg/core/deployer/providers-tester/kong/kong_test.go index dca330d69..7ea1d34e0 100644 --- a/pkg/core/deployer/providers/kong/kong_test.go +++ b/pkg/core/deployer/providers-tester/kong/kong_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/kong" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("KONG_") + fp = tester.InitArgs("KONG_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -49,6 +49,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ksyun-cdn/ksyun_cdn_test.go b/pkg/core/deployer/providers-tester/ksyun-cdn/ksyun_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/ksyun-cdn/ksyun_cdn_test.go rename to pkg/core/deployer/providers-tester/ksyun-cdn/ksyun_cdn_test.go index 1fea31028..b1b7bf70c 100644 --- a/pkg/core/deployer/providers/ksyun-cdn/ksyun_cdn_test.go +++ b/pkg/core/deployer/providers-tester/ksyun-cdn/ksyun_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ksyun-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("KSYUNCDN_") + fp = tester.InitArgs("KSYUNCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,7 +52,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToCertificate", func(t *testing.T) { @@ -64,6 +64,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ksyun-slb/ksyun_slb_test.go b/pkg/core/deployer/providers-tester/ksyun-slb/ksyun_slb_test.go similarity index 86% rename from pkg/core/deployer/providers/ksyun-slb/ksyun_slb_test.go rename to pkg/core/deployer/providers-tester/ksyun-slb/ksyun_slb_test.go index 05037db6c..e33c42206 100644 --- a/pkg/core/deployer/providers/ksyun-slb/ksyun_slb_test.go +++ b/pkg/core/deployer/providers-tester/ksyun-slb/ksyun_slb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ksyun-slb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("KSYUNSLB_") + fp = tester.InitArgs("KSYUNSLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/lecdn/lecdn_test.go b/pkg/core/deployer/providers-tester/lecdn/lecdn_test.go similarity index 87% rename from pkg/core/deployer/providers/lecdn/lecdn_test.go rename to pkg/core/deployer/providers-tester/lecdn/lecdn_test.go index 32b960d7c..581c04254 100644 --- a/pkg/core/deployer/providers/lecdn/lecdn_test.go +++ b/pkg/core/deployer/providers-tester/lecdn/lecdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/lecdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("LECDN_") + fp = tester.InitArgs("LECDN_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -57,6 +57,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/linode-los/linode_los_test.go b/pkg/core/deployer/providers-tester/linode-los/linode_los_test.go similarity index 83% rename from pkg/core/deployer/providers/linode-los/linode_los_test.go rename to pkg/core/deployer/providers-tester/linode-los/linode_los_test.go index 254ce85a1..3b6a43a46 100644 --- a/pkg/core/deployer/providers/linode-los/linode_los_test.go +++ b/pkg/core/deployer/providers-tester/linode-los/linode_los_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/linode-los" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("LINODELOS_") + fp = tester.InitArgs("LINODELOS_") fTestCertPath string fTestKeyPath string fApiToken string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/local/local_test.go b/pkg/core/deployer/providers-tester/local/local_test.go similarity index 86% rename from pkg/core/deployer/providers/local/local_test.go rename to pkg/core/deployer/providers-tester/local/local_test.go index 46b079aae..58a1e6658 100644 --- a/pkg/core/deployer/providers/local/local_test.go +++ b/pkg/core/deployer/providers-tester/local/local_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/local" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("LOCAL_") + fp = tester.InitArgs("LOCAL_") fTestCertPath string fTestKeyPath string fFilePathForCrt string @@ -71,7 +71,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_PFX", func(t *testing.T) { @@ -83,7 +83,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_JKS", func(t *testing.T) { @@ -96,6 +96,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/mohua-mvh/mohua_mvh_test.go b/pkg/core/deployer/providers-tester/mohua-mvh/mohua_mvh_test.go similarity index 84% rename from pkg/core/deployer/providers/mohua-mvh/mohua_mvh_test.go rename to pkg/core/deployer/providers-tester/mohua-mvh/mohua_mvh_test.go index e9797dedf..1d050261f 100644 --- a/pkg/core/deployer/providers/mohua-mvh/mohua_mvh_test.go +++ b/pkg/core/deployer/providers-tester/mohua-mvh/mohua_mvh_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/mohua-mvh" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("MOHUAMVH_") + fp = tester.InitArgs("MOHUAMVH_") fTestCertPath string fTestKeyPath string fUsername string @@ -51,6 +51,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/netlify/netlify_test.go b/pkg/core/deployer/providers-tester/netlify/netlify_test.go similarity index 81% rename from pkg/core/deployer/providers/netlify/netlify_test.go rename to pkg/core/deployer/providers-tester/netlify/netlify_test.go index 079752e2b..20c941472 100644 --- a/pkg/core/deployer/providers/netlify/netlify_test.go +++ b/pkg/core/deployer/providers-tester/netlify/netlify_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/netlify" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("NETLIFY_") + fp = tester.InitArgs("NETLIFY_") fTestCertPath string fTestKeyPath string fApiToken string @@ -44,6 +44,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/nginxproxymanager/nginxproxymanager_test.go b/pkg/core/deployer/providers-tester/nginxproxymanager/nginxproxymanager_test.go similarity index 87% rename from pkg/core/deployer/providers/nginxproxymanager/nginxproxymanager_test.go rename to pkg/core/deployer/providers-tester/nginxproxymanager/nginxproxymanager_test.go index 2a39a81e9..1f66a448c 100644 --- a/pkg/core/deployer/providers/nginxproxymanager/nginxproxymanager_test.go +++ b/pkg/core/deployer/providers-tester/nginxproxymanager/nginxproxymanager_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/nginxproxymanager" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("NGINXPROXYMANAGER_") + fp = tester.InitArgs("NGINXPROXYMANAGER_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -58,6 +58,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/proxmoxbs/proxmoxbs_test.go b/pkg/core/deployer/providers-tester/proxmoxbs/proxmoxbs_test.go similarity index 86% rename from pkg/core/deployer/providers/proxmoxbs/proxmoxbs_test.go rename to pkg/core/deployer/providers-tester/proxmoxbs/proxmoxbs_test.go index 87ba5ca9e..7057823e1 100644 --- a/pkg/core/deployer/providers/proxmoxbs/proxmoxbs_test.go +++ b/pkg/core/deployer/providers-tester/proxmoxbs/proxmoxbs_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/proxmoxbs" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("PROXMOXBS_") + fp = tester.InitArgs("PROXMOXBS_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -53,6 +53,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/proxmoxve/proxmoxve_test.go b/pkg/core/deployer/providers-tester/proxmoxve/proxmoxve_test.go similarity index 86% rename from pkg/core/deployer/providers/proxmoxve/proxmoxve_test.go rename to pkg/core/deployer/providers-tester/proxmoxve/proxmoxve_test.go index d6e63dd47..99f940929 100644 --- a/pkg/core/deployer/providers/proxmoxve/proxmoxve_test.go +++ b/pkg/core/deployer/providers-tester/proxmoxve/proxmoxve_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/proxmoxve" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("PROXMOXVE_") + fp = tester.InitArgs("PROXMOXVE_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -53,6 +53,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/qingcloud-lb/qingcloud_lb_test.go b/pkg/core/deployer/providers-tester/qingcloud-lb/qingcloud_lb_test.go similarity index 85% rename from pkg/core/deployer/providers/qingcloud-lb/qingcloud_lb_test.go rename to pkg/core/deployer/providers-tester/qingcloud-lb/qingcloud_lb_test.go index db378759b..c0816f840 100644 --- a/pkg/core/deployer/providers/qingcloud-lb/qingcloud_lb_test.go +++ b/pkg/core/deployer/providers-tester/qingcloud-lb/qingcloud_lb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/qingcloud-lb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("QINGCLOUDLB_") + fp = tester.InitArgs("QINGCLOUDLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -56,7 +56,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListenerId", func(t *testing.T) { @@ -69,6 +69,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/qiniu-cdn/qiniu_cdn_test.go b/pkg/core/deployer/providers-tester/qiniu-cdn/qiniu_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/qiniu-cdn/qiniu_cdn_test.go rename to pkg/core/deployer/providers-tester/qiniu-cdn/qiniu_cdn_test.go index d41d15698..3e9e0513b 100644 --- a/pkg/core/deployer/providers/qiniu-cdn/qiniu_cdn_test.go +++ b/pkg/core/deployer/providers-tester/qiniu-cdn/qiniu_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/qiniu-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("QINIUCDN_") + fp = tester.InitArgs("QINIUCDN_") fTestCertPath string fTestKeyPath string fAccessKey string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/qiniu-kodo/qiniu_kodo_test.go b/pkg/core/deployer/providers-tester/qiniu-kodo/qiniu_kodo_test.go similarity index 84% rename from pkg/core/deployer/providers/qiniu-kodo/qiniu_kodo_test.go rename to pkg/core/deployer/providers-tester/qiniu-kodo/qiniu_kodo_test.go index dc9452bd9..8b6907305 100644 --- a/pkg/core/deployer/providers/qiniu-kodo/qiniu_kodo_test.go +++ b/pkg/core/deployer/providers-tester/qiniu-kodo/qiniu_kodo_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/qiniu-kodo" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("QINIUKODO_") + fp = tester.InitArgs("QINIUKODO_") fTestCertPath string fTestKeyPath string fAccessKey string @@ -51,6 +51,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/qiniu-pili/qiniu_pili_test.go b/pkg/core/deployer/providers-tester/qiniu-pili/qiniu_pili_test.go similarity index 85% rename from pkg/core/deployer/providers/qiniu-pili/qiniu_pili_test.go rename to pkg/core/deployer/providers-tester/qiniu-pili/qiniu_pili_test.go index 9743c21e9..992230dd9 100644 --- a/pkg/core/deployer/providers/qiniu-pili/qiniu_pili_test.go +++ b/pkg/core/deployer/providers-tester/qiniu-pili/qiniu_pili_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/qiniu-pili" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("QINIUPILI_") + fp = tester.InitArgs("QINIUPILI_") fTestCertPath string fTestKeyPath string fAccessKey string @@ -51,6 +51,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/rainyun-rcdn/rainyun_rcdn_test.go b/pkg/core/deployer/providers-tester/rainyun-rcdn/rainyun_rcdn_test.go similarity index 84% rename from pkg/core/deployer/providers/rainyun-rcdn/rainyun_rcdn_test.go rename to pkg/core/deployer/providers-tester/rainyun-rcdn/rainyun_rcdn_test.go index a567e53bf..fb28d1219 100644 --- a/pkg/core/deployer/providers/rainyun-rcdn/rainyun_rcdn_test.go +++ b/pkg/core/deployer/providers-tester/rainyun-rcdn/rainyun_rcdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/rainyun-rcdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("RAINYUNRCDN_") + fp = tester.InitArgs("RAINYUNRCDN_") fTestCertPath string fTestKeyPath string fApiKey string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/rainyun-sslcenter/rainyun_sslcenter_test.go b/pkg/core/deployer/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go similarity index 78% rename from pkg/core/deployer/providers/rainyun-sslcenter/rainyun_sslcenter_test.go rename to pkg/core/deployer/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go index 148c04596..54e5be1e1 100644 --- a/pkg/core/deployer/providers/rainyun-sslcenter/rainyun_sslcenter_test.go +++ b/pkg/core/deployer/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/rainyun-sslcenter" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("RAINYUNSSLCENTER_") + fp = tester.InitArgs("RAINYUNSSLCENTER_") fTestCertPath string fTestKeyPath string fApiKey string @@ -39,6 +39,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ratpanel-console/ratpanel_console_test.go b/pkg/core/deployer/providers-tester/ratpanel-console/ratpanel_console_test.go similarity index 84% rename from pkg/core/deployer/providers/ratpanel-console/ratpanel_console_test.go rename to pkg/core/deployer/providers-tester/ratpanel-console/ratpanel_console_test.go index e8235855d..d053ec7d9 100644 --- a/pkg/core/deployer/providers/ratpanel-console/ratpanel_console_test.go +++ b/pkg/core/deployer/providers-tester/ratpanel-console/ratpanel_console_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ratpanel-console" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("RATPANELCONSOLE_") + fp = tester.InitArgs("RATPANELCONSOLE_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ratpanel/ratpanel_test.go b/pkg/core/deployer/providers-tester/ratpanel/ratpanel_test.go similarity index 86% rename from pkg/core/deployer/providers/ratpanel/ratpanel_test.go rename to pkg/core/deployer/providers-tester/ratpanel/ratpanel_test.go index 3579d5414..bab138dbf 100644 --- a/pkg/core/deployer/providers/ratpanel/ratpanel_test.go +++ b/pkg/core/deployer/providers-tester/ratpanel/ratpanel_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ratpanel" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("RATPANEL_") + fp = tester.InitArgs("RATPANEL_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -53,6 +53,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/s3/s3_test.go b/pkg/core/deployer/providers-tester/s3/s3_test.go similarity index 88% rename from pkg/core/deployer/providers/s3/s3_test.go rename to pkg/core/deployer/providers-tester/s3/s3_test.go index aec61ae83..25bbf9d99 100644 --- a/pkg/core/deployer/providers/s3/s3_test.go +++ b/pkg/core/deployer/providers-tester/s3/s3_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/s3" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("S3_") + fp = tester.InitArgs("S3_") fTestCertPath string fTestKeyPath string fSshHost string @@ -64,6 +64,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/safeline/safeline_test.go b/pkg/core/deployer/providers-tester/safeline/safeline_test.go similarity index 85% rename from pkg/core/deployer/providers/safeline/safeline_test.go rename to pkg/core/deployer/providers-tester/safeline/safeline_test.go index 009d9913a..2f7b37b1b 100644 --- a/pkg/core/deployer/providers/safeline/safeline_test.go +++ b/pkg/core/deployer/providers-tester/safeline/safeline_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/safeline" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("SAFELINE_") + fp = tester.InitArgs("SAFELINE_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -49,6 +49,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/samwaf-console/samwaf_console_test.go b/pkg/core/deployer/providers-tester/samwaf-console/samwaf_console_test.go similarity index 83% rename from pkg/core/deployer/providers/samwaf-console/samwaf_console_test.go rename to pkg/core/deployer/providers-tester/samwaf-console/samwaf_console_test.go index ce179875a..331a4d7c1 100644 --- a/pkg/core/deployer/providers/samwaf-console/samwaf_console_test.go +++ b/pkg/core/deployer/providers-tester/samwaf-console/samwaf_console_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/samwaf-console" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("SAMWAFCONSOLE_") + fp = tester.InitArgs("SAMWAFCONSOLE_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -46,6 +46,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/samwaf/samwaf_test.go b/pkg/core/deployer/providers-tester/samwaf/samwaf_test.go similarity index 85% rename from pkg/core/deployer/providers/samwaf/samwaf_test.go rename to pkg/core/deployer/providers-tester/samwaf/samwaf_test.go index a2e3e0e6b..85b36d076 100644 --- a/pkg/core/deployer/providers/samwaf/samwaf_test.go +++ b/pkg/core/deployer/providers-tester/samwaf/samwaf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/samwaf" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("SAMWAF_") + fp = tester.InitArgs("SAMWAF_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -49,6 +49,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ssh/ssh_test.go b/pkg/core/deployer/providers-tester/ssh/ssh_test.go similarity index 88% rename from pkg/core/deployer/providers/ssh/ssh_test.go rename to pkg/core/deployer/providers-tester/ssh/ssh_test.go index 633e67251..c63226107 100644 --- a/pkg/core/deployer/providers/ssh/ssh_test.go +++ b/pkg/core/deployer/providers-tester/ssh/ssh_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ssh" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("SSH_") + fp = tester.InitArgs("SSH_") fTestCertPath string fTestKeyPath string fSshHost string @@ -62,6 +62,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/synologydsm/synologydsm_test.go b/pkg/core/deployer/providers-tester/synologydsm/synologydsm_test.go similarity index 88% rename from pkg/core/deployer/providers/synologydsm/synologydsm_test.go rename to pkg/core/deployer/providers-tester/synologydsm/synologydsm_test.go index d6ea4ed44..0f537f67e 100644 --- a/pkg/core/deployer/providers/synologydsm/synologydsm_test.go +++ b/pkg/core/deployer/providers-tester/synologydsm/synologydsm_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/synologydsm" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("SYNOLOGYDSM_") + fp = tester.InitArgs("SYNOLOGYDSM_") fTestCertPath string fTestKeyPath string fServerUrl string @@ -59,6 +59,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-cdn/tencentcloud_cdn_test.go b/pkg/core/deployer/providers-tester/tencentcloud-cdn/tencentcloud_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/tencentcloud-cdn/tencentcloud_cdn_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-cdn/tencentcloud_cdn_test.go index a1f9c0f55..361b01035 100644 --- a/pkg/core/deployer/providers/tencentcloud-cdn/tencentcloud_cdn_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-cdn/tencentcloud_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDCDN_") + fp = tester.InitArgs("TENCENTCLOUDCDN_") fTestCertPath string fTestKeyPath string fSecretId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-clb/tencentcloud_clb_test.go b/pkg/core/deployer/providers-tester/tencentcloud-clb/tencentcloud_clb_test.go similarity index 84% rename from pkg/core/deployer/providers/tencentcloud-clb/tencentcloud_clb_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-clb/tencentcloud_clb_test.go index d4e4787ab..deb050e27 100644 --- a/pkg/core/deployer/providers/tencentcloud-clb/tencentcloud_clb_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-clb/tencentcloud_clb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-clb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDCLB_") + fp = tester.InitArgs("TENCENTCLOUDCLB_") fTestCertPath string fTestKeyPath string fSecretId string @@ -58,7 +58,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToListener", func(t *testing.T) { @@ -72,7 +72,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToRuleDomain", func(t *testing.T) { @@ -87,6 +87,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-cos/tencentcloud_cos_test.go b/pkg/core/deployer/providers-tester/tencentcloud-cos/tencentcloud_cos_test.go similarity index 85% rename from pkg/core/deployer/providers/tencentcloud-cos/tencentcloud_cos_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-cos/tencentcloud_cos_test.go index eb88c5198..1e6e90916 100644 --- a/pkg/core/deployer/providers/tencentcloud-cos/tencentcloud_cos_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-cos/tencentcloud_cos_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-cos" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDCOS_") + fp = tester.InitArgs("TENCENTCLOUDCOS_") fTestCertPath string fTestKeyPath string fSecretId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-css/tencentcloud_css_test.go b/pkg/core/deployer/providers-tester/tencentcloud-css/tencentcloud_css_test.go similarity index 83% rename from pkg/core/deployer/providers/tencentcloud-css/tencentcloud_css_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-css/tencentcloud_css_test.go index e98a13990..accb6e735 100644 --- a/pkg/core/deployer/providers/tencentcloud-css/tencentcloud_css_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-css/tencentcloud_css_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-css" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDCSS_") + fp = tester.InitArgs("TENCENTCLOUDCSS_") fTestCertPath string fTestKeyPath string fSecretId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-ecdn/tencentcloud_ecdn_test.go b/pkg/core/deployer/providers-tester/tencentcloud-ecdn/tencentcloud_ecdn_test.go similarity index 84% rename from pkg/core/deployer/providers/tencentcloud-ecdn/tencentcloud_ecdn_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-ecdn/tencentcloud_ecdn_test.go index 655fe78ec..b4de5864d 100644 --- a/pkg/core/deployer/providers/tencentcloud-ecdn/tencentcloud_ecdn_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-ecdn/tencentcloud_ecdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-ecdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDECDN_") + fp = tester.InitArgs("TENCENTCLOUDECDN_") fTestCertPath string fTestKeyPath string fSecretId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-eo/tencentcloud_eo_test.go b/pkg/core/deployer/providers-tester/tencentcloud-eo/tencentcloud_eo_test.go similarity index 86% rename from pkg/core/deployer/providers/tencentcloud-eo/tencentcloud_eo_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-eo/tencentcloud_eo_test.go index 74393a609..963c26665 100644 --- a/pkg/core/deployer/providers/tencentcloud-eo/tencentcloud_eo_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-eo/tencentcloud_eo_test.go @@ -6,12 +6,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-eo" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDEO_") + fp = tester.InitArgs("TENCENTCLOUDEO_") fTestCertPath string fTestKeyPath string fSecretId string @@ -54,6 +54,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-eomakers/tencentcloud_eomakers_test.go b/pkg/core/deployer/providers-tester/tencentcloud-eomakers/tencentcloud_eomakers_test.go similarity index 87% rename from pkg/core/deployer/providers/tencentcloud-eomakers/tencentcloud_eomakers_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-eomakers/tencentcloud_eomakers_test.go index fa1e0d6bb..596fb0224 100644 --- a/pkg/core/deployer/providers/tencentcloud-eomakers/tencentcloud_eomakers_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-eomakers/tencentcloud_eomakers_test.go @@ -6,12 +6,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-eomakers" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDEOMAKERS_") + fp = tester.InitArgs("TENCENTCLOUDEOMAKERS_") fTestCertPath string fTestKeyPath string fSecretId string @@ -58,6 +58,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-ga2/tencentcloud_ga2_test.go b/pkg/core/deployer/providers-tester/tencentcloud-ga2/tencentcloud_ga2_test.go similarity index 85% rename from pkg/core/deployer/providers/tencentcloud-ga2/tencentcloud_ga2_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-ga2/tencentcloud_ga2_test.go index 78cdfd557..953989b3c 100644 --- a/pkg/core/deployer/providers/tencentcloud-ga2/tencentcloud_ga2_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-ga2/tencentcloud_ga2_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-ga2" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDGA2_") + fp = tester.InitArgs("TENCENTCLOUDGA2_") fTestCertPath string fTestKeyPath string fSecretId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-gaap/tencentcloud_gaap_test.go b/pkg/core/deployer/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go similarity index 85% rename from pkg/core/deployer/providers/tencentcloud-gaap/tencentcloud_gaap_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go index 1ae0d1e68..ac2449db6 100644 --- a/pkg/core/deployer/providers/tencentcloud-gaap/tencentcloud_gaap_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-gaap" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUGAAP_") + fp = tester.InitArgs("TENCENTCLOUGAAP_") fTestCertPath string fTestKeyPath string fSecretId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-scf/tencentcloud_scf_test.go b/pkg/core/deployer/providers-tester/tencentcloud-scf/tencentcloud_scf_test.go similarity index 85% rename from pkg/core/deployer/providers/tencentcloud-scf/tencentcloud_scf_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-scf/tencentcloud_scf_test.go index 1b3e3ad49..64ba28aae 100644 --- a/pkg/core/deployer/providers/tencentcloud-scf/tencentcloud_scf_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-scf/tencentcloud_scf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-scf" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDSCF_") + fp = tester.InitArgs("TENCENTCLOUDSCF_") fTestCertPath string fTestKeyPath string fSecretId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-vod/tencentcloud_vod_test.go b/pkg/core/deployer/providers-tester/tencentcloud-vod/tencentcloud_vod_test.go similarity index 86% rename from pkg/core/deployer/providers/tencentcloud-vod/tencentcloud_vod_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-vod/tencentcloud_vod_test.go index 9c7423bc7..22c180cb8 100644 --- a/pkg/core/deployer/providers/tencentcloud-vod/tencentcloud_vod_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-vod/tencentcloud_vod_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-vod" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDVOD_") + fp = tester.InitArgs("TENCENTCLOUDVOD_") fTestCertPath string fTestKeyPath string fSecretId string @@ -54,6 +54,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/tencentcloud-waf/tencentcloud_waf_test.go b/pkg/core/deployer/providers-tester/tencentcloud-waf/tencentcloud_waf_test.go similarity index 87% rename from pkg/core/deployer/providers/tencentcloud-waf/tencentcloud_waf_test.go rename to pkg/core/deployer/providers-tester/tencentcloud-waf/tencentcloud_waf_test.go index 3d7e2f972..e1d889767 100644 --- a/pkg/core/deployer/providers/tencentcloud-waf/tencentcloud_waf_test.go +++ b/pkg/core/deployer/providers-tester/tencentcloud-waf/tencentcloud_waf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-waf" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("TENCENTCLOUDWAF_") + fp = tester.InitArgs("TENCENTCLOUDWAF_") fTestCertPath string fTestKeyPath string fSecretId string @@ -59,6 +59,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/testing/testing.go b/pkg/core/deployer/providers-tester/tester.go similarity index 57% rename from pkg/core/deployer/testing/testing.go rename to pkg/core/deployer/providers-tester/tester.go index 47b7634c4..fd100df20 100644 --- a/pkg/core/deployer/testing/testing.go +++ b/pkg/core/deployer/providers-tester/tester.go @@ -1,4 +1,4 @@ -package testing +package tester import ( "context" @@ -13,33 +13,33 @@ import ( "github.com/certimate-go/certimate/pkg/core/deployer" ) -type TestDeployArgs struct { +type DeployInput struct { CertPath string KeyPath string } -func TestDeploy(t *testing.T, testProvider deployer.Provider, testArgs TestDeployArgs) { - if _, err := os.Stat(testArgs.CertPath); os.IsNotExist(err) { +func Deploy(t *testing.T, provider deployer.Provider, input DeployInput) { + if _, err := os.Stat(input.CertPath); os.IsNotExist(err) { t.Errorf("err: test cert file not exist") return } - if _, err := os.Stat(testArgs.KeyPath); os.IsNotExist(err) { + if _, err := os.Stat(input.KeyPath); os.IsNotExist(err) { t.Errorf("err: test privkey file not exist") return } ctx := context.Background() - certData, _ := os.ReadFile(testArgs.CertPath) - privkeyData, _ := os.ReadFile(testArgs.KeyPath) + certData, _ := os.ReadFile(input.CertPath) + privkeyData, _ := os.ReadFile(input.KeyPath) assert.NotNil(t, certData) assert.NotNil(t, privkeyData) logger := slog.Default() logger.Enabled(ctx, slog.LevelDebug) - testProvider.SetLogger(logger) + provider.SetLogger(logger) - res, err := testProvider.Deploy(ctx, string(certData), string(privkeyData)) + res, err := provider.Deploy(ctx, string(certData), string(privkeyData)) require.NoError(t, err) require.NotNil(t, res) diff --git a/pkg/core/deployer/providers-tester/tester_args.go b/pkg/core/deployer/providers-tester/tester_args.go new file mode 100644 index 000000000..adcdc3dba --- /dev/null +++ b/pkg/core/deployer/providers-tester/tester_args.go @@ -0,0 +1,9 @@ +package tester + +import ( + "github.com/certimate-go/certimate/pkg/core/internal/testing" +) + +func InitArgs(prefix string) testing.ArgsParser { + return testing.InitArgs(prefix) +} diff --git a/pkg/core/deployer/providers/ucloud-ualb/ucloud_ualb_test.go b/pkg/core/deployer/providers-tester/ucloud-ualb/ucloud_ualb_test.go similarity index 86% rename from pkg/core/deployer/providers/ucloud-ualb/ucloud_ualb_test.go rename to pkg/core/deployer/providers-tester/ucloud-ualb/ucloud_ualb_test.go index 2df965a5d..060254815 100644 --- a/pkg/core/deployer/providers/ucloud-ualb/ucloud_ualb_test.go +++ b/pkg/core/deployer/providers-tester/ucloud-ualb/ucloud_ualb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-ualb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("UCLOUDUALB_") + fp = tester.InitArgs("UCLOUDUALB_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -56,6 +56,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn_test.go b/pkg/core/deployer/providers-tester/ucloud-ucdn/ucloud_ucdn_test.go similarity index 83% rename from pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn_test.go rename to pkg/core/deployer/providers-tester/ucloud-ucdn/ucloud_ucdn_test.go index aea04a87d..f09adb7e8 100644 --- a/pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn_test.go +++ b/pkg/core/deployer/providers-tester/ucloud-ucdn/ucloud_ucdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-ucdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("UCLOUDUCDN_") + fp = tester.InitArgs("UCLOUDUCDN_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ucloud-uclb/ucloud_uclb_test.go b/pkg/core/deployer/providers-tester/ucloud-uclb/ucloud_uclb_test.go similarity index 86% rename from pkg/core/deployer/providers/ucloud-uclb/ucloud_uclb_test.go rename to pkg/core/deployer/providers-tester/ucloud-uclb/ucloud_uclb_test.go index fa9189783..19036d8c9 100644 --- a/pkg/core/deployer/providers/ucloud-uclb/ucloud_uclb_test.go +++ b/pkg/core/deployer/providers-tester/ucloud-uclb/ucloud_uclb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-uclb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("UCLOUDUCLB_") + fp = tester.InitArgs("UCLOUDUCLB_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -56,6 +56,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ucloud-uewaf/ucloud_uewaf_test.go b/pkg/core/deployer/providers-tester/ucloud-uewaf/ucloud_uewaf_test.go similarity index 83% rename from pkg/core/deployer/providers/ucloud-uewaf/ucloud_uewaf_test.go rename to pkg/core/deployer/providers-tester/ucloud-uewaf/ucloud_uewaf_test.go index bfe7b0122..5c3ac2148 100644 --- a/pkg/core/deployer/providers/ucloud-uewaf/ucloud_uewaf_test.go +++ b/pkg/core/deployer/providers-tester/ucloud-uewaf/ucloud_uewaf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-uewaf" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("UCLOUDUEWAF_") + fp = tester.InitArgs("UCLOUDUEWAF_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ucloud-upathx/ucloud_upathx_test.go b/pkg/core/deployer/providers-tester/ucloud-upathx/ucloud_upathx_test.go similarity index 85% rename from pkg/core/deployer/providers/ucloud-upathx/ucloud_upathx_test.go rename to pkg/core/deployer/providers-tester/ucloud-upathx/ucloud_upathx_test.go index 067b6a704..614341906 100644 --- a/pkg/core/deployer/providers/ucloud-upathx/ucloud_upathx_test.go +++ b/pkg/core/deployer/providers-tester/ucloud-upathx/ucloud_upathx_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-upathx" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("UCLOUDUPATHX_") + fp = tester.InitArgs("UCLOUDUPATHX_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -53,6 +53,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/ucloud-us3/ucloud_us3_test.go b/pkg/core/deployer/providers-tester/ucloud-us3/ucloud_us3_test.go similarity index 85% rename from pkg/core/deployer/providers/ucloud-us3/ucloud_us3_test.go rename to pkg/core/deployer/providers-tester/ucloud-us3/ucloud_us3_test.go index 5e7acdbcd..c734a4a70 100644 --- a/pkg/core/deployer/providers/ucloud-us3/ucloud_us3_test.go +++ b/pkg/core/deployer/providers-tester/ucloud-us3/ucloud_us3_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-us3" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("UCLOUDUS3_") + fp = tester.InitArgs("UCLOUDUS3_") fTestCertPath string fTestKeyPath string fPrivateKey string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/unicloud-webhost/unicloud_webhost_test.go b/pkg/core/deployer/providers-tester/unicloud-webhost/unicloud_webhost_test.go similarity index 86% rename from pkg/core/deployer/providers/unicloud-webhost/unicloud_webhost_test.go rename to pkg/core/deployer/providers-tester/unicloud-webhost/unicloud_webhost_test.go index 202d28b36..d27d127a0 100644 --- a/pkg/core/deployer/providers/unicloud-webhost/unicloud_webhost_test.go +++ b/pkg/core/deployer/providers-tester/unicloud-webhost/unicloud_webhost_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/unicloud-webhost" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("UNICLOUDWEBHOST_") + fp = tester.InitArgs("UNICLOUDWEBHOST_") fTestCertPath string fTestKeyPath string fUsername string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/upyun-cdn/upyun_cdn_test.go b/pkg/core/deployer/providers-tester/upyun-cdn/upyun_cdn_test.go similarity index 82% rename from pkg/core/deployer/providers/upyun-cdn/upyun_cdn_test.go rename to pkg/core/deployer/providers-tester/upyun-cdn/upyun_cdn_test.go index 3d40ad283..70207a66c 100644 --- a/pkg/core/deployer/providers/upyun-cdn/upyun_cdn_test.go +++ b/pkg/core/deployer/providers-tester/upyun-cdn/upyun_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/upyun-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("UPYUNCDN_") + fp = tester.InitArgs("UPYUNCDN_") fTestCertPath string fTestKeyPath string fUsername string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/upyun-file/upyun_file_test.go b/pkg/core/deployer/providers-tester/upyun-file/upyun_file_test.go similarity index 84% rename from pkg/core/deployer/providers/upyun-file/upyun_file_test.go rename to pkg/core/deployer/providers-tester/upyun-file/upyun_file_test.go index 635aa2e32..55d247fe8 100644 --- a/pkg/core/deployer/providers/upyun-file/upyun_file_test.go +++ b/pkg/core/deployer/providers-tester/upyun-file/upyun_file_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/upyun-file" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("UPYUNFILE_") + fp = tester.InitArgs("UPYUNFILE_") fTestCertPath string fTestKeyPath string fUsername string @@ -51,6 +51,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/vercel/vercel_test.go b/pkg/core/deployer/providers-tester/vercel/vercel_test.go similarity index 81% rename from pkg/core/deployer/providers/vercel/vercel_test.go rename to pkg/core/deployer/providers-tester/vercel/vercel_test.go index fbe8d129f..5e883aaa6 100644 --- a/pkg/core/deployer/providers/vercel/vercel_test.go +++ b/pkg/core/deployer/providers-tester/vercel/vercel_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/vercel" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VERCEL_") + fp = tester.InitArgs("VERCEL_") fTestCertPath string fTestKeyPath string fApiAccessToken string @@ -43,6 +43,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-alb/volcengine_alb_test.go b/pkg/core/deployer/providers-tester/volcengine-alb/volcengine_alb_test.go similarity index 85% rename from pkg/core/deployer/providers/volcengine-alb/volcengine_alb_test.go rename to pkg/core/deployer/providers-tester/volcengine-alb/volcengine_alb_test.go index 71faef9c6..83e68a4fd 100644 --- a/pkg/core/deployer/providers/volcengine-alb/volcengine_alb_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-alb/volcengine_alb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-alb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINEALB_") + fp = tester.InitArgs("VOLCENGINEALB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-apig/volcengine_apig_test.go b/pkg/core/deployer/providers-tester/volcengine-apig/volcengine_apig_test.go similarity index 85% rename from pkg/core/deployer/providers/volcengine-apig/volcengine_apig_test.go rename to pkg/core/deployer/providers-tester/volcengine-apig/volcengine_apig_test.go index d3210c60a..6ac2d1c34 100644 --- a/pkg/core/deployer/providers/volcengine-apig/volcengine_apig_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-apig/volcengine_apig_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-apig" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINEAPIG_") + fp = tester.InitArgs("VOLCENGINEAPIG_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-cdn/volcengine_cdn_test.go b/pkg/core/deployer/providers-tester/volcengine-cdn/volcengine_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/volcengine-cdn/volcengine_cdn_test.go rename to pkg/core/deployer/providers-tester/volcengine-cdn/volcengine_cdn_test.go index 9d98219cb..30c8323d6 100644 --- a/pkg/core/deployer/providers/volcengine-cdn/volcengine_cdn_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-cdn/volcengine_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINECDN_") + fp = tester.InitArgs("VOLCENGINECDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-clb/volcengine_clb_test.go b/pkg/core/deployer/providers-tester/volcengine-clb/volcengine_clb_test.go similarity index 85% rename from pkg/core/deployer/providers/volcengine-clb/volcengine_clb_test.go rename to pkg/core/deployer/providers-tester/volcengine-clb/volcengine_clb_test.go index ed6bde0e3..1e26cabdb 100644 --- a/pkg/core/deployer/providers/volcengine-clb/volcengine_clb_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-clb/volcengine_clb_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-clb" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINECLB_") + fp = tester.InitArgs("VOLCENGINECLB_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,6 +52,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-dcdn/volcengine_dcdn_test.go b/pkg/core/deployer/providers-tester/volcengine-dcdn/volcengine_dcdn_test.go similarity index 84% rename from pkg/core/deployer/providers/volcengine-dcdn/volcengine_dcdn_test.go rename to pkg/core/deployer/providers-tester/volcengine-dcdn/volcengine_dcdn_test.go index 2690af806..e76b3d4c0 100644 --- a/pkg/core/deployer/providers/volcengine-dcdn/volcengine_dcdn_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-dcdn/volcengine_dcdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-dcdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINEDCDN_") + fp = tester.InitArgs("VOLCENGINEDCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-imagex/volcengine_imagex_test.go b/pkg/core/deployer/providers-tester/volcengine-imagex/volcengine_imagex_test.go similarity index 86% rename from pkg/core/deployer/providers/volcengine-imagex/volcengine_imagex_test.go rename to pkg/core/deployer/providers-tester/volcengine-imagex/volcengine_imagex_test.go index 33d57a8ec..5b737fed8 100644 --- a/pkg/core/deployer/providers/volcengine-imagex/volcengine_imagex_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-imagex/volcengine_imagex_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-imagex" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINEIMAGEX_") + fp = tester.InitArgs("VOLCENGINEIMAGEX_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-live/volcengine_live_test.go b/pkg/core/deployer/providers-tester/volcengine-live/volcengine_live_test.go similarity index 84% rename from pkg/core/deployer/providers/volcengine-live/volcengine_live_test.go rename to pkg/core/deployer/providers-tester/volcengine-live/volcengine_live_test.go index 38667475f..d1b8a4a39 100644 --- a/pkg/core/deployer/providers/volcengine-live/volcengine_live_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-live/volcengine_live_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-live" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINELIVE_") + fp = tester.InitArgs("VOLCENGINELIVE_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -48,6 +48,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-tos/volcengine_tos_test.go b/pkg/core/deployer/providers-tester/volcengine-tos/volcengine_tos_test.go similarity index 86% rename from pkg/core/deployer/providers/volcengine-tos/volcengine_tos_test.go rename to pkg/core/deployer/providers-tester/volcengine-tos/volcengine_tos_test.go index c770fee13..79670a0c9 100644 --- a/pkg/core/deployer/providers/volcengine-tos/volcengine_tos_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-tos/volcengine_tos_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-tos" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINETOS_") + fp = tester.InitArgs("VOLCENGINETOS_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-vod/volcengine_vod_test.go b/pkg/core/deployer/providers-tester/volcengine-vod/volcengine_vod_test.go similarity index 87% rename from pkg/core/deployer/providers/volcengine-vod/volcengine_vod_test.go rename to pkg/core/deployer/providers-tester/volcengine-vod/volcengine_vod_test.go index 34df4ea21..0db52a965 100644 --- a/pkg/core/deployer/providers/volcengine-vod/volcengine_vod_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-vod/volcengine_vod_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-vod" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINEVOD_") + fp = tester.InitArgs("VOLCENGINEVOD_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -56,6 +56,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/volcengine-waf/volcengine_waf_test.go b/pkg/core/deployer/providers-tester/volcengine-waf/volcengine_waf_test.go similarity index 86% rename from pkg/core/deployer/providers/volcengine-waf/volcengine_waf_test.go rename to pkg/core/deployer/providers-tester/volcengine-waf/volcengine_waf_test.go index e9534e854..08e24b66a 100644 --- a/pkg/core/deployer/providers/volcengine-waf/volcengine_waf_test.go +++ b/pkg/core/deployer/providers-tester/volcengine-waf/volcengine_waf_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-waf" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("VOLCENGINEWAF_") + fp = tester.InitArgs("VOLCENGINEWAF_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -55,6 +55,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/wangsu-cdn/wangsu_cdn_test.go b/pkg/core/deployer/providers-tester/wangsu-cdn/wangsu_cdn_test.go similarity index 83% rename from pkg/core/deployer/providers/wangsu-cdn/wangsu_cdn_test.go rename to pkg/core/deployer/providers-tester/wangsu-cdn/wangsu_cdn_test.go index 487a3fad8..5aeba0e7a 100644 --- a/pkg/core/deployer/providers/wangsu-cdn/wangsu_cdn_test.go +++ b/pkg/core/deployer/providers-tester/wangsu-cdn/wangsu_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/wangsu-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("WANGSUCDN_") + fp = tester.InitArgs("WANGSUCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/wangsu-cdnpro/wangsu_cdnpro_test.go b/pkg/core/deployer/providers-tester/wangsu-cdnpro/wangsu_cdnpro_test.go similarity index 88% rename from pkg/core/deployer/providers/wangsu-cdnpro/wangsu_cdnpro_test.go rename to pkg/core/deployer/providers-tester/wangsu-cdnpro/wangsu_cdnpro_test.go index 93d45e916..65487122c 100644 --- a/pkg/core/deployer/providers/wangsu-cdnpro/wangsu_cdnpro_test.go +++ b/pkg/core/deployer/providers-tester/wangsu-cdnpro/wangsu_cdnpro_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/wangsu-cdnpro" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("WANGSUCDNPRO_") + fp = tester.InitArgs("WANGSUCDNPRO_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -63,6 +63,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/wangsu-certificate/wangsu_certificate_test.go b/pkg/core/deployer/providers-tester/wangsu-certificate/wangsu_certificate_test.go similarity index 84% rename from pkg/core/deployer/providers/wangsu-certificate/wangsu_certificate_test.go rename to pkg/core/deployer/providers-tester/wangsu-certificate/wangsu_certificate_test.go index 4c142dbe6..b59d72546 100644 --- a/pkg/core/deployer/providers/wangsu-certificate/wangsu_certificate_test.go +++ b/pkg/core/deployer/providers-tester/wangsu-certificate/wangsu_certificate_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/wangsu-certificate" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("WANGSUCERTIFICATE_") + fp = tester.InitArgs("WANGSUCERTIFICATE_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -47,6 +47,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/webhook/webhook_test.go b/pkg/core/deployer/providers-tester/webhook/webhook_test.go similarity index 85% rename from pkg/core/deployer/providers/webhook/webhook_test.go rename to pkg/core/deployer/providers-tester/webhook/webhook_test.go index 055f323dd..32ed5b318 100644 --- a/pkg/core/deployer/providers/webhook/webhook_test.go +++ b/pkg/core/deployer/providers-tester/webhook/webhook_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/webhook" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("WEBHOOK_") + fp = tester.InitArgs("WEBHOOK_") fTestCertPath string fTestKeyPath string fWebhookUrl string @@ -51,6 +51,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/zenlayer-cdn/zenlayer_cdn_test.go b/pkg/core/deployer/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go similarity index 84% rename from pkg/core/deployer/providers/zenlayer-cdn/zenlayer_cdn_test.go rename to pkg/core/deployer/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go index 396e1ac55..914a0baee 100644 --- a/pkg/core/deployer/providers/zenlayer-cdn/zenlayer_cdn_test.go +++ b/pkg/core/deployer/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/zenlayer-cdn" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ZENLAYERCDN_") + fp = tester.InitArgs("ZENLAYERCDN_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -52,7 +52,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToCertificate", func(t *testing.T) { @@ -64,6 +64,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/zenlayer-ga/zenlayer_ga_test.go b/pkg/core/deployer/providers-tester/zenlayer-ga/zenlayer_ga_test.go similarity index 84% rename from pkg/core/deployer/providers/zenlayer-ga/zenlayer_ga_test.go rename to pkg/core/deployer/providers-tester/zenlayer-ga/zenlayer_ga_test.go index 65892332a..9231e432e 100644 --- a/pkg/core/deployer/providers/zenlayer-ga/zenlayer_ga_test.go +++ b/pkg/core/deployer/providers-tester/zenlayer-ga/zenlayer_ga_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/zenlayer-ga" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) var ( - fp = it.Args("ZENLAYERGA_") + fp = tester.InitArgs("ZENLAYERGA_") fTestCertPath string fTestKeyPath string fAccessKeyId string @@ -51,7 +51,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) t.Run("Deploy_ToCertificate", func(t *testing.T) { @@ -63,6 +63,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) + tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) }) } diff --git a/pkg/core/deployer/providers/k8s-secret/k8s_secret_client_test.go b/pkg/core/deployer/providers/k8s-secret/k8s_secret_client_test.go deleted file mode 100644 index df04a2f1f..000000000 --- a/pkg/core/deployer/providers/k8s-secret/k8s_secret_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package k8ssecret - -import ( - "strings" - "testing" -) - -const testKubeConfig = `apiVersion: v1 -kind: Config -clusters: - - name: test - cluster: - server: https://127.0.0.1:6443 - insecure-skip-tls-verify: true -contexts: - - name: test - context: - cluster: test - user: test -current-context: test -users: - - name: test - user: - token: test-token -` - -// Secrets live in the core API group, which is served under "/api". -// If APIPath is left empty, rest.RESTClientFor builds requests against -// "/v1/namespaces/..." and the API server answers 404 -// ("the server could not find the requested resource"). -func TestCreateK8sClientSetsCoreAPIPath(t *testing.T) { - client, err := createK8sClient(testKubeConfig) - if err != nil { - t.Fatalf("createK8sClient() returned an unexpected error: %v", err) - } - - const want = "/api/v1" - if got := client.Get().URL().Path; !strings.HasPrefix(got, want) { - t.Errorf("request path = %q, want it to start with %q", got, want) - } -} diff --git a/pkg/core/deployer/providers/k8s-secret/k8s_secret_test.go b/pkg/core/deployer/providers/k8s-secret/k8s_secret_test.go index 005a5cba9..df04a2f1f 100644 --- a/pkg/core/deployer/providers/k8s-secret/k8s_secret_test.go +++ b/pkg/core/deployer/providers/k8s-secret/k8s_secret_test.go @@ -1,66 +1,41 @@ -package k8ssecret_test +package k8ssecret import ( - "os" + "strings" "testing" - - "github.com/stretchr/testify/require" - - impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/k8s-secret" - it "github.com/certimate-go/certimate/pkg/core/deployer/testing" ) -var ( - fp = it.Args("K8SSECRET_") - fTestCertPath string - fTestKeyPath string - fKubeConfig string - fNamespace string - fSecretName string - fSecretDataKeyForCrt string - fSecretDataKeyForKey string -) +const testKubeConfig = `apiVersion: v1 +kind: Config +clusters: + - name: test + cluster: + server: https://127.0.0.1:6443 + insecure-skip-tls-verify: true +contexts: + - name: test + context: + cluster: test + user: test +current-context: test +users: + - name: test + user: + token: test-token +` -func init() { - fp.DefineString(&fTestCertPath, "TESTCERTPATH") - fp.DefineString(&fTestKeyPath, "TESTKEYPATH") - fp.DefineString(&fKubeConfig, "KUBECONFIG") - fp.DefineString(&fNamespace, "NAMESPACE", "default") - fp.DefineString(&fSecretName, "SECRETNAME") - fp.DefineString(&fSecretDataKeyForCrt, "SECRETDATAKEYFORCRT", "tls.crt") - fp.DefineString(&fSecretDataKeyForKey, "SECRETDATAKEYFORKEY", "tls.key") -} - -/* -Shell command to run this test: - - go test -v ./k8s_secret_test.go -args \ - --K8SSECRET_TESTCERTPATH="/path/to/your-test-cert.pem" \ - --K8SSECRET_TESTKEYPATH="/path/to/your-test-key.pem" \ - --K8SSECRET_KUBECONFIG="..." \ - --K8SSECRET_NAMESPACE="default" \ - --K8SSECRET_SECRETNAME="secret" \ - --K8SSECRET_SECRETDATAKEYFORCRT="tls.crt" \ - --K8SSECRET_SECRETDATAKEYFORKEY="tls.key" -*/ -func TestProvider(t *testing.T) { - fp.Parse() - - if fKubeConfigStat, err := os.Stat(fKubeConfig); err == nil && !fKubeConfigStat.IsDir() { - fKubeConfigBytes, _ := os.ReadFile(fKubeConfig) - fKubeConfig = string(fKubeConfigBytes) +// Secrets live in the core API group, which is served under "/api". +// If APIPath is left empty, rest.RESTClientFor builds requests against +// "/v1/namespaces/..." and the API server answers 404 +// ("the server could not find the requested resource"). +func TestCreateK8sClientSetsCoreAPIPath(t *testing.T) { + client, err := createK8sClient(testKubeConfig) + if err != nil { + t.Fatalf("createK8sClient() returned an unexpected error: %v", err) } - t.Run("Deploy", func(t *testing.T) { - provider, err := impl.NewDeployer(&impl.DeployerConfig{ - KubeConfig: fKubeConfig, - Namespace: fNamespace, - SecretName: fSecretName, - SecretDataKeyForCrt: fSecretDataKeyForCrt, - SecretDataKeyForKey: fSecretDataKeyForKey, - }) - require.NoError(t, err) - - it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath}) - }) + const want = "/api/v1" + if got := client.Get().URL().Path; !strings.HasPrefix(got, want) { + t.Errorf("request path = %q, want it to start with %q", got, want) + } } diff --git a/pkg/core/deployer/testing/args.go b/pkg/core/deployer/testing/args.go deleted file mode 100644 index 077fd3fa6..000000000 --- a/pkg/core/deployer/testing/args.go +++ /dev/null @@ -1,9 +0,0 @@ -package testing - -import ( - "github.com/certimate-go/certimate/pkg/core/internal/testing" -) - -func Args(prefix string) testing.ArgsParser { - return testing.Args(prefix) -} diff --git a/pkg/core/internal/testing/argsparser.go b/pkg/core/internal/testing/argsparser.go index 559e1a04f..e03ec8e76 100644 --- a/pkg/core/internal/testing/argsparser.go +++ b/pkg/core/internal/testing/argsparser.go @@ -20,7 +20,7 @@ type argsParser struct { vals []any } -func Args(prefix string) ArgsParser { +func InitArgs(prefix string) ArgsParser { return &argsParser{ prefix: prefix, keys: make([]string, 0), diff --git a/pkg/core/notifier/providers/dingtalkbot/dingtalkbot_test.go b/pkg/core/notifier/providers-tester/dingtalkbot/dingtalkbot_test.go similarity index 80% rename from pkg/core/notifier/providers/dingtalkbot/dingtalkbot_test.go rename to pkg/core/notifier/providers-tester/dingtalkbot/dingtalkbot_test.go index 38fe32e57..98285846c 100644 --- a/pkg/core/notifier/providers/dingtalkbot/dingtalkbot_test.go +++ b/pkg/core/notifier/providers-tester/dingtalkbot/dingtalkbot_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/dingtalkbot" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("DINGTALKBOT_") + fp = tester.InitArgs("DINGTALKBOT_") fWebhookUrl string fSecret string ) @@ -37,6 +37,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) } diff --git a/pkg/core/notifier/providers/discordbot/discordbot_test.go b/pkg/core/notifier/providers-tester/discordbot/discordbot_test.go similarity index 80% rename from pkg/core/notifier/providers/discordbot/discordbot_test.go rename to pkg/core/notifier/providers-tester/discordbot/discordbot_test.go index 7f54c8c4e..308812880 100644 --- a/pkg/core/notifier/providers/discordbot/discordbot_test.go +++ b/pkg/core/notifier/providers-tester/discordbot/discordbot_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/discordbot" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("DISCORDBOT_") + fp = tester.InitArgs("DISCORDBOT_") fApiToken string fChannelId string ) @@ -37,6 +37,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) } diff --git a/pkg/core/notifier/providers/email/email_test.go b/pkg/core/notifier/providers-tester/email/email_test.go similarity index 89% rename from pkg/core/notifier/providers/email/email_test.go rename to pkg/core/notifier/providers-tester/email/email_test.go index ccfafe622..54a733777 100644 --- a/pkg/core/notifier/providers/email/email_test.go +++ b/pkg/core/notifier/providers-tester/email/email_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/email" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("EMAIL_") + fp = tester.InitArgs("EMAIL_") fSmtpHost string fSmtpPort int64 fSmtpTLS bool @@ -57,7 +57,7 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) t.Run("Notify_Html", func(t *testing.T) { @@ -77,6 +77,6 @@ func TestProvider(t *testing.T) { } const mockHtml = "

Hello Certimate!

Google" - it.TestNotify(t, provider, it.TestNotifyArgs{Message: mockHtml}) + tester.Notify(t, provider, tester.NotifyInput{Message: mockHtml}) }) } diff --git a/pkg/core/notifier/providers/larkbot/larkbot_test.go b/pkg/core/notifier/providers-tester/larkbot/larkbot_test.go similarity index 80% rename from pkg/core/notifier/providers/larkbot/larkbot_test.go rename to pkg/core/notifier/providers-tester/larkbot/larkbot_test.go index 4142f0cb1..634a94b25 100644 --- a/pkg/core/notifier/providers/larkbot/larkbot_test.go +++ b/pkg/core/notifier/providers-tester/larkbot/larkbot_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/larkbot" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("LARKBOT_") + fp = tester.InitArgs("LARKBOT_") fWebhookUrl string fSecret string ) @@ -37,6 +37,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) } diff --git a/pkg/core/notifier/providers/matrix/matrix_test.go b/pkg/core/notifier/providers-tester/matrix/matrix_test.go similarity index 85% rename from pkg/core/notifier/providers/matrix/matrix_test.go rename to pkg/core/notifier/providers-tester/matrix/matrix_test.go index b8d5f1cef..ace653aed 100644 --- a/pkg/core/notifier/providers/matrix/matrix_test.go +++ b/pkg/core/notifier/providers-tester/matrix/matrix_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/matrix" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("MATRIX_") + fp = tester.InitArgs("MATRIX_") fServerUrl string fUserId string fAccessToken string @@ -45,6 +45,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) } diff --git a/pkg/core/notifier/providers/mattermost/mattermost_test.go b/pkg/core/notifier/providers-tester/mattermost/mattermost_test.go similarity index 84% rename from pkg/core/notifier/providers/mattermost/mattermost_test.go rename to pkg/core/notifier/providers-tester/mattermost/mattermost_test.go index 8bb176d94..20eec8401 100644 --- a/pkg/core/notifier/providers/mattermost/mattermost_test.go +++ b/pkg/core/notifier/providers-tester/mattermost/mattermost_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/mattermost" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("MATTERMOST_") + fp = tester.InitArgs("MATTERMOST_") fServerUrl string fChannelId string fUsername string @@ -45,6 +45,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) } diff --git a/pkg/core/notifier/providers/slackbot/slackbot_test.go b/pkg/core/notifier/providers-tester/slackbot/slackbot_test.go similarity index 80% rename from pkg/core/notifier/providers/slackbot/slackbot_test.go rename to pkg/core/notifier/providers-tester/slackbot/slackbot_test.go index 423b78c94..e3374fc1b 100644 --- a/pkg/core/notifier/providers/slackbot/slackbot_test.go +++ b/pkg/core/notifier/providers-tester/slackbot/slackbot_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/slackbot" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("SLACKBOT_") + fp = tester.InitArgs("SLACKBOT_") fApiToken string fChannelId string ) @@ -37,6 +37,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) } diff --git a/pkg/core/notifier/providers/telegrambot/telegrambot_test.go b/pkg/core/notifier/providers-tester/telegrambot/telegrambot_test.go similarity index 80% rename from pkg/core/notifier/providers/telegrambot/telegrambot_test.go rename to pkg/core/notifier/providers-tester/telegrambot/telegrambot_test.go index 91a2928f4..58c5e6275 100644 --- a/pkg/core/notifier/providers/telegrambot/telegrambot_test.go +++ b/pkg/core/notifier/providers-tester/telegrambot/telegrambot_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/telegrambot" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("TELEGRAMBOT_") + fp = tester.InitArgs("TELEGRAMBOT_") fApiToken string fChatId string ) @@ -37,6 +37,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) } diff --git a/pkg/core/notifier/testing/testing.go b/pkg/core/notifier/providers-tester/tester.go similarity index 57% rename from pkg/core/notifier/testing/testing.go rename to pkg/core/notifier/providers-tester/tester.go index e8eb51ec2..abfdba613 100644 --- a/pkg/core/notifier/testing/testing.go +++ b/pkg/core/notifier/providers-tester/tester.go @@ -1,4 +1,4 @@ -package testing +package tester import ( "context" @@ -17,21 +17,21 @@ const ( mockMessage = "test_message" ) -type TestNotifyArgs struct { +type NotifyInput struct { Subject string Message string } -func TestNotify(t *testing.T, testProvider notifier.Provider, testArgs TestNotifyArgs) { +func Notify(t *testing.T, provider notifier.Provider, input NotifyInput) { ctx := context.Background() - message := lo.Ternary(testArgs.Message != "", testArgs.Message, mockMessage) - subject := lo.Ternary(testArgs.Subject != "", testArgs.Subject, mockSubject) + message := lo.Ternary(input.Message != "", input.Message, mockMessage) + subject := lo.Ternary(input.Subject != "", input.Subject, mockSubject) logger := slog.Default() logger.Enabled(ctx, slog.LevelDebug) - testProvider.SetLogger(logger) + provider.SetLogger(logger) - res, err := testProvider.Notify(ctx, message, subject) + res, err := provider.Notify(ctx, message, subject) require.NoError(t, err) require.NotNil(t, res) diff --git a/pkg/core/notifier/providers-tester/tester_args.go b/pkg/core/notifier/providers-tester/tester_args.go new file mode 100644 index 000000000..adcdc3dba --- /dev/null +++ b/pkg/core/notifier/providers-tester/tester_args.go @@ -0,0 +1,9 @@ +package tester + +import ( + "github.com/certimate-go/certimate/pkg/core/internal/testing" +) + +func InitArgs(prefix string) testing.ArgsParser { + return testing.InitArgs(prefix) +} diff --git a/pkg/core/notifier/providers/webhook/webhook_test.go b/pkg/core/notifier/providers-tester/webhook/webhook_test.go similarity index 82% rename from pkg/core/notifier/providers/webhook/webhook_test.go rename to pkg/core/notifier/providers-tester/webhook/webhook_test.go index ba0ad24d1..486955d3a 100644 --- a/pkg/core/notifier/providers/webhook/webhook_test.go +++ b/pkg/core/notifier/providers-tester/webhook/webhook_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/webhook" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("WEBHOOK_") + fp = tester.InitArgs("WEBHOOK_") fWebhookUrl string fWebhookContentType string ) @@ -41,6 +41,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) } diff --git a/pkg/core/notifier/providers/wecombot/wecombot_test.go b/pkg/core/notifier/providers-tester/wecombot/wecombot_test.go similarity index 77% rename from pkg/core/notifier/providers/wecombot/wecombot_test.go rename to pkg/core/notifier/providers-tester/wecombot/wecombot_test.go index e249d49d5..59ec99b99 100644 --- a/pkg/core/notifier/providers/wecombot/wecombot_test.go +++ b/pkg/core/notifier/providers-tester/wecombot/wecombot_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/require" + tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester" impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/wecombot" - it "github.com/certimate-go/certimate/pkg/core/notifier/testing" ) var ( - fp = it.Args("WECOMBOT_") + fp = tester.InitArgs("WECOMBOT_") fWebhookUrl string ) @@ -33,6 +33,6 @@ func TestProvider(t *testing.T) { }) require.NoError(t, err) - it.TestNotify(t, provider, it.TestNotifyArgs{}) + tester.Notify(t, provider, tester.NotifyInput{}) }) } diff --git a/pkg/core/notifier/testing/args.go b/pkg/core/notifier/testing/args.go deleted file mode 100644 index 077fd3fa6..000000000 --- a/pkg/core/notifier/testing/args.go +++ /dev/null @@ -1,9 +0,0 @@ -package testing - -import ( - "github.com/certimate-go/certimate/pkg/core/internal/testing" -) - -func Args(prefix string) testing.ArgsParser { - return testing.Args(prefix) -}