instance.cfg 2.57 KB
Newer Older
1 2 3
[buildout]
parts =
  slapos-test-runner
4
  publish
5

6 7
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
8 9 10 11
offline = true

[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
12 13 14 15 16
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
17 18 19

[download-source]
recipe = slapos.recipe.build:gitclone
20
git-executable = {{ git_location }}/bin/git
21 22 23

[slapos]
<= download-source
24
repository = {{ slapos_location }}
25 26 27

[directory]
recipe = slapos.cookbook:mkdirectory
28 29
bin = ${buildout:directory}/bin
working-dir = ${buildout:directory}/tmp
30
etc = ${buildout:directory}/etc
31 32 33

[slapos-test-runner]
recipe = slapos.cookbook:wrapper
34
wrapper-path = ${directory:bin}/runTestSuite
35
command-line =
36 37 38
  {{ buildout['bin-directory'] }}/runTestSuite
  --python_interpreter={{ buildout['bin-directory'] }}/{{ interpreter }}
  --source_code_path_list={{ ','.join(tests.splitlines()) }}
39 40

environment =
41 42 43 44 45 46
  PATH=${slapos-test-runner-environment:PATH}
  SLAPOS_TEST_IPV4=${slapos-test-runner-environment:SLAPOS_TEST_IPV4}
  SLAPOS_TEST_IPV6=${slapos-test-runner-environment:SLAPOS_TEST_IPV6}
  SLAPOS_TEST_WORKING_DIR=${slapos-test-runner-environment:SLAPOS_TEST_WORKING_DIR}

[slapos-test-runner-environment]
47
PATH = {{ buildout['bin-directory'] }}:{{ curl_location }}/bin/:{{ faketime_location }}/bin/:/usr/bin/:/bin
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
SLAPOS_TEST_IPV4 = ${slap-configuration:ipv4-random}
SLAPOS_TEST_IPV6 = ${slap-configuration:ipv6-random}
SLAPOS_TEST_WORKING_DIR = ${directory:working-dir}

[slapos-local-development-environment.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/${:_buildout_section_name_}
template = inline:
  export PATH=${slapos-test-runner-environment:PATH}:$PATH
  export SLAPOS_TEST_IPV4=${slapos-test-runner-environment:SLAPOS_TEST_IPV4}
  export SLAPOS_TEST_IPV6=${slapos-test-runner-environment:SLAPOS_TEST_IPV6}
  export SLAPOS_TEST_WORKING_DIR=${slapos-test-runner-environment:SLAPOS_TEST_WORKING_DIR}
  {% set shared_part_list = [] %}
  {% for shared_part in buildout['shared-part-list'].splitlines() -%}
    {% do shared_part_list.append(shared_part) %}
  {%- endfor %}
  export SLAPOS_TEST_SHARED_PART_LIST={{ os.pathsep.join(shared_part_list) }}
  echo "Environment loaded."
  echo "To work on a test, execute:"
  echo "   SLAPOS_TEST_DEBUG=1 {{ interpreter }} setup.py test"
  echo "from test folder"
  echo

[publish]
recipe = slapos.cookbook:publish
environment-script = ${slapos-local-development-environment.sh:rendered}