Added zammad_api_client_php test job.
This commit is contained in:
parent
d8913eec6d
commit
41d551ed25
2 changed files with 40 additions and 20 deletions
|
@ -379,7 +379,27 @@ test:browser:integration:api_client_ruby:
|
||||||
- cd zammad_api_client_ruby
|
- cd zammad_api_client_ruby
|
||||||
- bundle install
|
- bundle install
|
||||||
- export TEST_URL=http://$IP:$BROWSER_PORT
|
- export TEST_URL=http://$IP:$BROWSER_PORT
|
||||||
- rspec spec/zammad_api_spec.rb || script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 1 1
|
- rspec || (cd .. && script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 1 1)
|
||||||
|
- cd .. && script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 0 1
|
||||||
|
|
||||||
|
test:browser:integration:api_client_php:
|
||||||
|
stage: browser
|
||||||
|
dependencies:
|
||||||
|
- browser:build
|
||||||
|
tags:
|
||||||
|
- browser
|
||||||
|
script:
|
||||||
|
- RAILS_ENV=test rake db:create
|
||||||
|
- cp contrib/auto_wizard_test.json auto_wizard.json
|
||||||
|
- script/build/test_startup.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 1
|
||||||
|
- GIT_SSH=/ssh_wrapper_client_php.sh git clone git@github.com:martini/zammad_api_client_php || script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 1 1
|
||||||
|
- wget http://$IP:$BROWSER_PORT/api/v1/getting_started/auto_wizard
|
||||||
|
- cd zammad_api_client_php
|
||||||
|
- composer install
|
||||||
|
- export ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_URL=http://$IP:$BROWSER_PORT
|
||||||
|
- export ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_USERNAME=master@example.com
|
||||||
|
- export ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD=test
|
||||||
|
- vendor/bin/phpunit || (cd .. && script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 1 1)
|
||||||
- cd .. && script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 0 1
|
- cd .. && script/build/test_shutdown.sh $RAILS_ENV $BROWSER_PORT $WS_PORT 0 1
|
||||||
|
|
||||||
test:browser:twitter_ff:
|
test:browser:twitter_ff:
|
||||||
|
|
|
@ -134,19 +134,19 @@ class JobTest < ActiveSupport::TestCase
|
||||||
assert_not(job1.executable?)
|
assert_not(job1.executable?)
|
||||||
|
|
||||||
job1.last_run_at = Time.zone.now - 15.minutes
|
job1.last_run_at = Time.zone.now - 15.minutes
|
||||||
job1.save
|
job1.save!
|
||||||
assert_not(job1.executable?)
|
assert_not(job1.executable?)
|
||||||
|
|
||||||
job1.updated_at = Time.zone.now - 15.minutes
|
job1.updated_at = Time.zone.now - 15.minutes
|
||||||
job1.save
|
job1.save!
|
||||||
assert(job1.executable?)
|
assert(job1.executable?)
|
||||||
|
|
||||||
job1.active = false
|
job1.active = false
|
||||||
job1.save
|
job1.save!
|
||||||
assert_not(job1.executable?)
|
assert_not(job1.executable?)
|
||||||
|
|
||||||
job1.active = true
|
job1.active = true
|
||||||
job1.save
|
job1.save!
|
||||||
assert_not(job1.executable?)
|
assert_not(job1.executable?)
|
||||||
|
|
||||||
assert_not(job1.in_timeplan?)
|
assert_not(job1.in_timeplan?)
|
||||||
|
@ -161,11 +161,11 @@ class JobTest < ActiveSupport::TestCase
|
||||||
6 => 'Sat',
|
6 => 'Sat',
|
||||||
}
|
}
|
||||||
job1.timeplan['days'][day_map[time.wday]] = true
|
job1.timeplan['days'][day_map[time.wday]] = true
|
||||||
job1.save
|
job1.save!
|
||||||
assert_not(job1.in_timeplan?)
|
assert_not(job1.in_timeplan?(time))
|
||||||
job1.timeplan['hours'][time.hour.to_s] = true
|
job1.timeplan['hours'][time.hour.to_s] = true
|
||||||
job1.save
|
job1.save!
|
||||||
assert_not(job1.in_timeplan?)
|
assert_not(job1.in_timeplan?(time))
|
||||||
min = time.min
|
min = time.min
|
||||||
if min < 9
|
if min < 9
|
||||||
min = 0
|
min = 0
|
||||||
|
@ -181,19 +181,19 @@ class JobTest < ActiveSupport::TestCase
|
||||||
min = 50
|
min = 50
|
||||||
end
|
end
|
||||||
job1.timeplan['minutes'][min.to_s] = true
|
job1.timeplan['minutes'][min.to_s] = true
|
||||||
job1.save
|
job1.save!
|
||||||
assert(job1.in_timeplan?)
|
assert(job1.in_timeplan?(time))
|
||||||
|
|
||||||
job1.timeplan['hours'][time.hour] = true
|
job1.timeplan['hours'][time.hour] = true
|
||||||
job1.save
|
job1.save!
|
||||||
|
|
||||||
job1.timeplan['minutes'][min] = true
|
job1.timeplan['minutes'][min] = true
|
||||||
job1.save
|
job1.save!
|
||||||
assert(job1.in_timeplan?)
|
assert(job1.in_timeplan?(time))
|
||||||
|
|
||||||
# execute jobs
|
# execute jobs
|
||||||
job1.updated_at = Time.zone.now - 15.minutes
|
job1.updated_at = Time.zone.now - 15.minutes
|
||||||
job1.save
|
job1.save!
|
||||||
Job.run
|
Job.run
|
||||||
|
|
||||||
assert(job1.next_run_at)
|
assert(job1.next_run_at)
|
||||||
|
@ -223,7 +223,7 @@ class JobTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
# execute jobs again
|
# execute jobs again
|
||||||
job1.updated_at = Time.zone.now - 15.minutes
|
job1.updated_at = Time.zone.now - 15.minutes
|
||||||
job1.save
|
job1.save!
|
||||||
Job.run
|
Job.run
|
||||||
|
|
||||||
# verify changes on tickets
|
# verify changes on tickets
|
||||||
|
@ -547,13 +547,13 @@ class JobTest < ActiveSupport::TestCase
|
||||||
assert_equal('2016-03-25 01:40:00 UTC', next_run_at.to_s)
|
assert_equal('2016-03-25 01:40:00 UTC', next_run_at.to_s)
|
||||||
|
|
||||||
job1.last_run_at = Time.zone.parse('2016-03-18 10:00:01 UTC')
|
job1.last_run_at = Time.zone.parse('2016-03-18 10:00:01 UTC')
|
||||||
job1.save
|
job1.save!
|
||||||
time_now = Time.zone.parse('2016-03-18 10:00:02 UTC')
|
time_now = Time.zone.parse('2016-03-18 10:00:02 UTC')
|
||||||
next_run_at = job1.next_run_at_calculate(time_now)
|
next_run_at = job1.next_run_at_calculate(time_now)
|
||||||
assert_equal('2016-03-18 10:40:00 UTC', next_run_at.to_s)
|
assert_equal('2016-03-18 10:40:00 UTC', next_run_at.to_s)
|
||||||
|
|
||||||
job1.last_run_at = Time.zone.parse('2016-03-18 10:40:01 UTC')
|
job1.last_run_at = Time.zone.parse('2016-03-18 10:40:01 UTC')
|
||||||
job1.save
|
job1.save!
|
||||||
time_now = Time.zone.parse('2016-03-18 10:40:02 UTC')
|
time_now = Time.zone.parse('2016-03-18 10:40:02 UTC')
|
||||||
next_run_at = job1.next_run_at_calculate(time_now)
|
next_run_at = job1.next_run_at_calculate(time_now)
|
||||||
assert_equal('2016-03-21 01:00:00 UTC', next_run_at.to_s)
|
assert_equal('2016-03-21 01:00:00 UTC', next_run_at.to_s)
|
||||||
|
@ -631,13 +631,13 @@ class JobTest < ActiveSupport::TestCase
|
||||||
assert_equal('2016-03-18 00:00:00 UTC', next_run_at.to_s)
|
assert_equal('2016-03-18 00:00:00 UTC', next_run_at.to_s)
|
||||||
|
|
||||||
job1.last_run_at = Time.zone.parse('2016-03-17 23:45:01 UTC')
|
job1.last_run_at = Time.zone.parse('2016-03-17 23:45:01 UTC')
|
||||||
job1.save
|
job1.save!
|
||||||
time_now = Time.zone.parse('2016-03-17 23:51:23 UTC')
|
time_now = Time.zone.parse('2016-03-17 23:51:23 UTC')
|
||||||
next_run_at = job1.next_run_at_calculate(time_now)
|
next_run_at = job1.next_run_at_calculate(time_now)
|
||||||
assert_equal('2016-03-18 00:00:00 UTC', next_run_at.to_s)
|
assert_equal('2016-03-18 00:00:00 UTC', next_run_at.to_s)
|
||||||
|
|
||||||
job1.last_run_at = Time.zone.parse('2016-03-17 23:59:01 UTC')
|
job1.last_run_at = Time.zone.parse('2016-03-17 23:59:01 UTC')
|
||||||
job1.save
|
job1.save!
|
||||||
time_now = Time.zone.parse('2016-03-17 23:59:23 UTC')
|
time_now = Time.zone.parse('2016-03-17 23:59:23 UTC')
|
||||||
next_run_at = job1.next_run_at_calculate(time_now)
|
next_run_at = job1.next_run_at_calculate(time_now)
|
||||||
assert_equal('2016-03-18 00:40:00 UTC', next_run_at.to_s)
|
assert_equal('2016-03-18 00:40:00 UTC', next_run_at.to_s)
|
||||||
|
|
Loading…
Reference in a new issue