Skip to content

Instantly share code, notes, and snippets.

@lucywyman
Created November 29, 2017 19:08
Show Gist options
  • Save lucywyman/4f067eea08a6c09891be7ab80fc263f1 to your computer and use it in GitHub Desktop.
Save lucywyman/4f067eea08a6c09891be7ab80fc263f1 to your computer and use it in GitHub Desktop.
(ns puppetlabs.orchestrator.integration.jarjar.service-status
(:require [clojure.test :refer :all]
[clojure.pprint :refer :all]
[puppetlabs.enterprise.aio.test-utils :as jar-jar]
[puppetlabs.kitchensink.core :refer [mapvals]]
[puppetlabs.orchestrator.testutils :refer [with-silenced-logging]]
[puppetlabs.orchestrator.testutils.jarjar :refer [jar-jar-orch-client with-pe-fixture *jar-jar* *jar-jar-token*] :as testutils]))
(use-fixtures :once with-silenced-logging with-pe-fixture)
;; ensure status endpoint has the correct keys and all services are up
(deftest service-is-running
(let [config (jar-jar/app->config *jar-jar*)
orch-client (jar-jar-orch-client config)]
(testing "ensure status endpoint is running"
(let [response (orch-client :get "/status" {})
body (:body response)]
; Verify that Orchestrator service is running
(is (= "running" (:state body)) "The orchestrator service is not running")))))
(ns puppetlabs.orchestrator.integration.jarjar.work
(:require [clojure.test :refer :all]
[cheshire.core :as json]
[puppetlabs.enterprise.aio.test-utils :as jar-jar]
[puppetlabs.orchestrator.master :as master]
[puppetlabs.orchestrator.testutils :refer [with-silenced-logging]] [puppetlabs.orchestrator.testutils.jarjar
:refer [jar-jar-orch-client with-pe-fixture *jar-jar*]]))
(use-fixtures :once with-silenced-logging with-pe-fixture)
(deftest stolen-from-tasks-test
(let [{:keys [orchestrator webserver]} (jar-jar/app->config *jar-jar*)
master-ssl (-> webserver
:puppet-server
(select-keys [:ssl-key :ssl-cert :ssl-ca-cert]))
master-url (:master-url orchestrator)]))
(deftest master-backed-task-api-test
(let [orch-client (jar-jar-orch-client (jar-jar/app->config *jar-jar*))]
; (testing "tasks listing endpoint"
; (doseq [env ["production" "test"]]
; (testing (format "returns tasks in the '%s' environment" env)
(let [{:keys [status body]} (orch-client :get "/status" {})]
(is (= 200 status)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment