                                 testutils/catalog-request-options)]
           (is (= 500 (:status catalog-response)))
           (is (re-find #"Non-zero exit code returned while running" (:body catalog-response)))
-          (is (logged? #"Executed an external process which logged to STDERR: production" :warn))))))
+          (is (logged? #"Executed an external process which logged to STDERR: production" :warn)))))))
+
+(deftest ^:integration code-id-request-test-no-environment
   (testing "code id is not added and 400 is returned if environment is not included in request"
     (logging/with-test-logging
      (bootstrap/with-puppetserver-running

          {:code-id-command (script-path "echo")
           :code-content-command (script-path "echo")}}
     (let [catalog (testutils/get-catalog)]
       (is (= "production" (get catalog "code_id"))))))
  (testing "code id is added to the request body for catalog requests"
    ; As we have set code-id-command to echo, the code id will
    ; be the result of running `echo $environment`, which will
    ; be production here.

          {:code-id-command (script-path "echo")
           :code-content-command (script-path "echo")}}
     (let [catalog (testutils/post-catalog)]
       (is (= "production" (get catalog "code_id")))))))

(deftest ^:integration code-id-request-test-non-zero-exit
    (testing "catalog request fails if code-id-command returns a non-zero exit code"
      ; As we have set code-id-command to warn, the code id will
      ; be the result of running `warn_echo_and_error $environment`, which will
