 ExUnit.start()
 
 unless :integration in ExUnit.configuration[:exclude] do
-  unless System.get_env("ORIENTDB_USER") do
+  user = System.get_env("ORIENTDB_USER") ||
     Mix.raise """
     The $ORIENTDB_USER variable is empty, but it needs to be set to an
     OrientDB admin username in order to run MarcoPolo tests.
     """
-  end
 
-  unless System.get_env("ORIENTDB_PASS") do
+  pass = System.get_env("ORIENTDB_PASS") ||
     Mix.raise """
     The $ORIENTDB_PASS variable is empty, but it needs to be set to the
     password for the user specified in the $ORIENTDB_USER variable in order to
     run MarcoPolo tests.
     """
-  end
 
   case :gen_tcp.connect('localhost', 2424, []) do
     {:ok, _} ->


  run_script.("""
  SET ignoreErrors true;
  DROP DATABASE remote:localhost/MarcoPoloTest root root;
  DROP DATABASE remote:localhost/MarcoPoloTestGenerated root root;
  DROP DATABASE remote:localhost/MarcoPoloToDrop root root;
  SET ignoreErrors false;

  CREATE DATABASE remote:localhost/MarcoPoloTest root root plocal;
  CREATE DATABASE remote:localhost/MarcoPoloToDrop root root memory;
  """)

  output = run_script.("""
  CONNECT remote:localhost/MarcoPoloTest admin admin;
  CREATE CLUSTER schemaless;
  CREATE CLASS Schemaless CLUSTER schemaless;
  """)

  clusters = [{"schemaless", extract_cluster_id.(output)}|clusters]

  output = run_script.("""
  CONNECT remote:localhost/MarcoPoloTest admin admin;
  CREATE CLUSTER schemaful;
  CREATE CLASS Schemaful;
  CREATE PROPERTY Schemaful.myString STRING;
  """)

  ]

  defmodule TestHelpers do
    def user,     do: unquote(user)
    def password, do: unquote(pass)

    def cluster_id(name) do
      {_, id} = List.keyfind(unquote(Macro.escape(clusters)), name, 0)
