Skip to content

Commit

Permalink
Merge "testing: make monitoring testing optional, disabled by default"
Browse files Browse the repository at this point in the history
  • Loading branch information
Microzuul CI authored and Gerrit Code Review committed Dec 19, 2023
2 parents fe6afa2 + f8791f2 commit ee0d50e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
12 changes: 9 additions & 3 deletions cli/sfconfig/cmd/dev/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ var DevCmd = &cobra.Command{
var DevPrepareCmd = &cobra.Command{
Use: "prepare",
Short: "prepare dev environment",
Run: func(cmd *cobra.Command, args []string) { Run() },
Run: func(cmd *cobra.Command, args []string) { Run(cmd) },
}

func init() {
var installPrometheus bool
DevPrepareCmd.Flags().BoolVar(&installPrometheus, "with-prometheus", false, "Add this flag to spin a prometheus instance as well")
DevCmd.AddCommand(DevPrepareCmd)
}

func Run() {
func Run(cmd *cobra.Command) {
withPrometheus, _ := cmd.Flags().GetBool("with-prometheus")
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&zap.Options{Development: true})))
sfconfig := config.GetSFConfigOrDie()
fmt.Println("sfconfig started with: ", sfconfig)
Expand All @@ -59,10 +62,13 @@ func Run() {
EnsureNamespaces(&env)
EnsureMicroshiftWorkarounds(&env)
EnsureCertManager(&env)
// the Prometheus Operator is a dependency of the SF Operator so we must install it regardless of the --with-prometheus flag
EnsurePrometheusOperator(&env)
gerrit.EnsureGerrit(&env, sfconfig.FQDN)
EnsureGerritAccess(sfconfig.FQDN)
sfprometheus.EnsurePrometheus(&env, sfconfig.FQDN, false)
if withPrometheus {
sfprometheus.EnsurePrometheus(&env, sfconfig.FQDN, false)
}
EnsureDemoConfig(&env, &sfconfig)
nodepool.CreateNamespaceForNodepool(&env, "", "nodepool", "")
EnsureCRD()
Expand Down
1 change: 1 addition & 0 deletions roles/run-tests/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
microshift_host: "microshift.dev"
test_monitoring: false
1 change: 1 addition & 0 deletions roles/run-tests/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
when: "{{ mode == 'olm' }}"
- name: zuul-client-api
- name: test-monitoring
when: "{{ test_monitoring == 'true' }}"
- name: zuul-components
- name: test-log-forwarding
loop_control:
Expand Down
5 changes: 4 additions & 1 deletion roles/sfconfig-dev-prepare/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
- set_fact:
with_prometheus_flag: "{{ '--with-prometheus' if test_monitoring == 'true' else '' }}"

- name: Run the sfconfig dev prepare
command: "tools/sfconfig dev prepare"
command: "tools/sfconfig dev prepare {{ with_prometheus_flag }}"
args:
chdir: "{{ zuul.project.src_dir }}"
1 change: 1 addition & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- 199.204.44.24
- 199.204.47.54
inject_dev_ssh_keys: true
test_monitoring: "false"

- job:
name: sf-operator-multinode
Expand Down

0 comments on commit ee0d50e

Please sign in to comment.