diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f48bf54..e7d95e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,19 +32,20 @@ $ deactivate $ rm -r .venv ``` - ## Development Environment A vagrant file is available to create a icinga / opm / grafana stack and install check_patroni. You can then add a server to the supervision and -watch the graphs in grafana. It's in `./test/vagrant`. +watch the graphs in grafana. It's in the `vagrant` directory. A vagrant file can be found in [this repository](https://github.com/ioguix/vagrant-patroni to generate a patroni/etcd setup. +The `README.md` can be geneated with `./docs/make_readme.sh`. + ## Executing Tests -The pytests are in `./test` and use a moker to provide a json response instead +The pytests are in `./tests` and use a moker to provide a json response instead of having to call the patroni API. diff --git a/doc/make_readme.sh b/docs/make_readme.sh similarity index 100% rename from doc/make_readme.sh rename to docs/make_readme.sh diff --git a/test/json/cluster_config_has_changed.json b/tests/json/cluster_config_has_changed.json similarity index 100% rename from test/json/cluster_config_has_changed.json rename to tests/json/cluster_config_has_changed.json diff --git a/test/json/cluster_has_leader_ko.json b/tests/json/cluster_has_leader_ko.json similarity index 100% rename from test/json/cluster_has_leader_ko.json rename to tests/json/cluster_has_leader_ko.json diff --git a/test/json/cluster_has_leader_ok.json b/tests/json/cluster_has_leader_ok.json similarity index 100% rename from test/json/cluster_has_leader_ok.json rename to tests/json/cluster_has_leader_ok.json diff --git a/test/json/cluster_has_replica_ko.json b/tests/json/cluster_has_replica_ko.json similarity index 100% rename from test/json/cluster_has_replica_ko.json rename to tests/json/cluster_has_replica_ko.json diff --git a/test/json/cluster_has_replica_ko_lag.json b/tests/json/cluster_has_replica_ko_lag.json similarity index 100% rename from test/json/cluster_has_replica_ko_lag.json rename to tests/json/cluster_has_replica_ko_lag.json diff --git a/test/json/cluster_has_replica_ok.json b/tests/json/cluster_has_replica_ok.json similarity index 100% rename from test/json/cluster_has_replica_ok.json rename to tests/json/cluster_has_replica_ok.json diff --git a/test/json/cluster_has_replica_ok_lag.json b/tests/json/cluster_has_replica_ok_lag.json similarity index 100% rename from test/json/cluster_has_replica_ok_lag.json rename to tests/json/cluster_has_replica_ok_lag.json diff --git a/test/json/cluster_is_in_maintenance_ko.json b/tests/json/cluster_is_in_maintenance_ko.json similarity index 100% rename from test/json/cluster_is_in_maintenance_ko.json rename to tests/json/cluster_is_in_maintenance_ko.json diff --git a/test/json/cluster_is_in_maintenance_ko_pause_false.json b/tests/json/cluster_is_in_maintenance_ko_pause_false.json similarity index 100% rename from test/json/cluster_is_in_maintenance_ko_pause_false.json rename to tests/json/cluster_is_in_maintenance_ko_pause_false.json diff --git a/test/json/cluster_is_in_maintenance_ok.json b/tests/json/cluster_is_in_maintenance_ok.json similarity index 100% rename from test/json/cluster_is_in_maintenance_ok.json rename to tests/json/cluster_is_in_maintenance_ok.json diff --git a/test/json/cluster_is_in_maintenance_ok_pause_false.json b/tests/json/cluster_is_in_maintenance_ok_pause_false.json similarity index 100% rename from test/json/cluster_is_in_maintenance_ok_pause_false.json rename to tests/json/cluster_is_in_maintenance_ok_pause_false.json diff --git a/test/json/cluster_node_count.json b/tests/json/cluster_node_count.json similarity index 100% rename from test/json/cluster_node_count.json rename to tests/json/cluster_node_count.json diff --git a/test/json/cluster_node_count_critical.json b/tests/json/cluster_node_count_critical.json similarity index 100% rename from test/json/cluster_node_count_critical.json rename to tests/json/cluster_node_count_critical.json diff --git a/test/json/cluster_node_count_ok.json b/tests/json/cluster_node_count_ok.json similarity index 100% rename from test/json/cluster_node_count_ok.json rename to tests/json/cluster_node_count_ok.json diff --git a/test/json/cluster_node_count_running_critical.json b/tests/json/cluster_node_count_running_critical.json similarity index 100% rename from test/json/cluster_node_count_running_critical.json rename to tests/json/cluster_node_count_running_critical.json diff --git a/test/json/cluster_node_count_running_warning.json b/tests/json/cluster_node_count_running_warning.json similarity index 100% rename from test/json/cluster_node_count_running_warning.json rename to tests/json/cluster_node_count_running_warning.json diff --git a/test/json/cluster_node_count_warning.json b/tests/json/cluster_node_count_warning.json similarity index 100% rename from test/json/cluster_node_count_warning.json rename to tests/json/cluster_node_count_warning.json diff --git a/test/json/node_is_alive.json b/tests/json/node_is_alive.json similarity index 100% rename from test/json/node_is_alive.json rename to tests/json/node_is_alive.json diff --git a/test/json/node_is_pending_restart_ko.json b/tests/json/node_is_pending_restart_ko.json similarity index 100% rename from test/json/node_is_pending_restart_ko.json rename to tests/json/node_is_pending_restart_ko.json diff --git a/test/json/node_is_pending_restart_ok.json b/tests/json/node_is_pending_restart_ok.json similarity index 100% rename from test/json/node_is_pending_restart_ok.json rename to tests/json/node_is_pending_restart_ok.json diff --git a/test/json/node_is_primary_ko.json b/tests/json/node_is_primary_ko.json similarity index 100% rename from test/json/node_is_primary_ko.json rename to tests/json/node_is_primary_ko.json diff --git a/test/json/node_is_primary_ok.json b/tests/json/node_is_primary_ok.json similarity index 100% rename from test/json/node_is_primary_ok.json rename to tests/json/node_is_primary_ok.json diff --git a/test/json/node_is_replica_ko.json b/tests/json/node_is_replica_ko.json similarity index 100% rename from test/json/node_is_replica_ko.json rename to tests/json/node_is_replica_ko.json diff --git a/test/json/node_is_replica_ok.json b/tests/json/node_is_replica_ok.json similarity index 100% rename from test/json/node_is_replica_ok.json rename to tests/json/node_is_replica_ok.json diff --git a/test/json/node_patroni_version.json b/tests/json/node_patroni_version.json similarity index 100% rename from test/json/node_patroni_version.json rename to tests/json/node_patroni_version.json diff --git a/test/json/node_tl_has_changed.json b/tests/json/node_tl_has_changed.json similarity index 100% rename from test/json/node_tl_has_changed.json rename to tests/json/node_tl_has_changed.json diff --git a/test/test_cluster_config_has_changed.py b/tests/test_cluster_config_has_changed.py similarity index 100% rename from test/test_cluster_config_has_changed.py rename to tests/test_cluster_config_has_changed.py diff --git a/test/test_cluster_has_leader.py b/tests/test_cluster_has_leader.py similarity index 100% rename from test/test_cluster_has_leader.py rename to tests/test_cluster_has_leader.py diff --git a/test/test_cluster_has_replica.py b/tests/test_cluster_has_replica.py similarity index 100% rename from test/test_cluster_has_replica.py rename to tests/test_cluster_has_replica.py diff --git a/test/test_cluster_is_in_maintenance.py b/tests/test_cluster_is_in_maintenance.py similarity index 100% rename from test/test_cluster_is_in_maintenance.py rename to tests/test_cluster_is_in_maintenance.py diff --git a/test/test_cluster_node_count.py b/tests/test_cluster_node_count.py similarity index 100% rename from test/test_cluster_node_count.py rename to tests/test_cluster_node_count.py diff --git a/test/test_node_is_alive.py b/tests/test_node_is_alive.py similarity index 100% rename from test/test_node_is_alive.py rename to tests/test_node_is_alive.py diff --git a/test/test_node_is_pending_restart.py b/tests/test_node_is_pending_restart.py similarity index 100% rename from test/test_node_is_pending_restart.py rename to tests/test_node_is_pending_restart.py diff --git a/test/test_node_is_primary.py b/tests/test_node_is_primary.py similarity index 100% rename from test/test_node_is_primary.py rename to tests/test_node_is_primary.py diff --git a/test/test_node_is_replica.py b/tests/test_node_is_replica.py similarity index 100% rename from test/test_node_is_replica.py rename to tests/test_node_is_replica.py diff --git a/test/test_node_patroni_version.py b/tests/test_node_patroni_version.py similarity index 100% rename from test/test_node_patroni_version.py rename to tests/test_node_patroni_version.py diff --git a/test/test_node_tl_has_changed.py b/tests/test_node_tl_has_changed.py similarity index 100% rename from test/test_node_tl_has_changed.py rename to tests/test_node_tl_has_changed.py diff --git a/test/tools.py b/tests/tools.py similarity index 100% rename from test/tools.py rename to tests/tools.py diff --git a/test/vagrant/LICENSE b/vagrant/LICENSE similarity index 100% rename from test/vagrant/LICENSE rename to vagrant/LICENSE diff --git a/test/vagrant/Makefile b/vagrant/Makefile similarity index 100% rename from test/vagrant/Makefile rename to vagrant/Makefile diff --git a/test/vagrant/README.md b/vagrant/README.md similarity index 100% rename from test/vagrant/README.md rename to vagrant/README.md diff --git a/test/vagrant/Vagrantfile b/vagrant/Vagrantfile similarity index 100% rename from test/vagrant/Vagrantfile rename to vagrant/Vagrantfile diff --git a/test/vagrant/grafana/cluster_status_cluster1.json b/vagrant/grafana/cluster_status_cluster1.json similarity index 100% rename from test/vagrant/grafana/cluster_status_cluster1.json rename to vagrant/grafana/cluster_status_cluster1.json diff --git a/test/vagrant/grafana/node_status_p1.json b/vagrant/grafana/node_status_p1.json similarity index 100% rename from test/vagrant/grafana/node_status_p1.json rename to vagrant/grafana/node_status_p1.json diff --git a/test/vagrant/grafana/node_status_p2.json b/vagrant/grafana/node_status_p2.json similarity index 100% rename from test/vagrant/grafana/node_status_p2.json rename to vagrant/grafana/node_status_p2.json diff --git a/test/vagrant/provision/check_patroni.bash b/vagrant/provision/check_patroni.bash similarity index 100% rename from test/vagrant/provision/check_patroni.bash rename to vagrant/provision/check_patroni.bash diff --git a/test/vagrant/provision/director.bash b/vagrant/provision/director.bash similarity index 100% rename from test/vagrant/provision/director.bash rename to vagrant/provision/director.bash diff --git a/test/vagrant/provision/icinga2.bash b/vagrant/provision/icinga2.bash similarity index 100% rename from test/vagrant/provision/icinga2.bash rename to vagrant/provision/icinga2.bash