summaryrefslogtreecommitdiff
path: root/files/puppet/modules/pixelated/manifests/tests.pp
blob: a0264aedf87d63c168161c0ac1702850f0e8997b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Install functional test for Pixelated based on bahave and phantomjs
# The tetst are integrated in 'leap test'
class pixelated::tests {
  include stdlib
  $webapp = hiera('webapp')
  $invite = $webapp['invite_required']
  File {
    owner => root,
    group => root,
    mode  => '0644',
  }

  file { '/srv/leap/tests_custom':
    ensure => directory,
    mode   => '0755',
  }
  file { '/srv/leap/tests_custom/pixelated.rb':
    source => 'puppet:///modules/pixelated/leap_test.rb',
    owner  => 'root',
    group  => 'root',
    mode   => '0755',
  }

  ensure_packages(['python-pip', 'curl', 'bzip2', 'python-enum','python-pycurl'])

  package{['behave','selenium']:
    ensure   => installed,
    provider => 'pip',
    require  => Package['python-pip'],
  }

 file{'/usr/local/bin/phantomjs':
    source => 'puppet:///modules/pixelated/phantomjs',
    owner  => 'root',
    group  => 'root',
    mode   => '0755',
  }
 
  file{'/srv/leap/tests_custom/functional-tests':
    ensure  => directory,
    recurse => true,
    purge   => true,
    source  => 'puppet:///modules/pixelated/functional-tests',
  }
  cron {'run_functional_tests':
    command     => "(date; INVITE_CODE_ENABLED=$invite /usr/bin/mk-job pixelated-functional-tests /usr/local/bin/behave --tags @staging --tags ~@wip --no-capture -k /srv/leap/tests_custom/functional-tests/) >> /var/log/check_mk_jobs.log 2>&1",
    environment => 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
    user        => 'root',
    minute      => 27,
    notify      => Exec['dummy_register_job'],
  }
  exec {'dummy_register_job':
    command     => '/usr/bin/mk-job pixelated-functional-tests /bin/true',
    require     => Class['::check_mk::agent::install'],
    refreshonly => true,
  }
}