diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a667ceaf8931..4fb1f05b37b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -379,7 +379,27 @@ test:browser:integration:api_client_ruby: - cd zammad_api_client_ruby - bundle install - 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 test:browser:twitter_ff: diff --git a/test/unit/job_test.rb b/test/unit/job_test.rb index 63c8c1b13b5b..71533282b7de 100644 --- a/test/unit/job_test.rb +++ b/test/unit/job_test.rb @@ -134,19 +134,19 @@ class JobTest < ActiveSupport::TestCase assert_not(job1.executable?) job1.last_run_at = Time.zone.now - 15.minutes - job1.save + job1.save! assert_not(job1.executable?) job1.updated_at = Time.zone.now - 15.minutes - job1.save + job1.save! assert(job1.executable?) job1.active = false - job1.save + job1.save! assert_not(job1.executable?) job1.active = true - job1.save + job1.save! assert_not(job1.executable?) assert_not(job1.in_timeplan?) @@ -161,11 +161,11 @@ class JobTest < ActiveSupport::TestCase 6 => 'Sat', } job1.timeplan['days'][day_map[time.wday]] = true - job1.save - assert_not(job1.in_timeplan?) + job1.save! + assert_not(job1.in_timeplan?(time)) job1.timeplan['hours'][time.hour.to_s] = true - job1.save - assert_not(job1.in_timeplan?) + job1.save! + assert_not(job1.in_timeplan?(time)) min = time.min if min < 9 min = 0 @@ -181,19 +181,19 @@ class JobTest < ActiveSupport::TestCase min = 50 end job1.timeplan['minutes'][min.to_s] = true - job1.save - assert(job1.in_timeplan?) + job1.save! + assert(job1.in_timeplan?(time)) job1.timeplan['hours'][time.hour] = true - job1.save + job1.save! job1.timeplan['minutes'][min] = true - job1.save - assert(job1.in_timeplan?) + job1.save! + assert(job1.in_timeplan?(time)) # execute jobs job1.updated_at = Time.zone.now - 15.minutes - job1.save + job1.save! Job.run assert(job1.next_run_at) @@ -223,7 +223,7 @@ class JobTest < ActiveSupport::TestCase # execute jobs again job1.updated_at = Time.zone.now - 15.minutes - job1.save + job1.save! Job.run # 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) 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') next_run_at = job1.next_run_at_calculate(time_now) 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.save + job1.save! time_now = Time.zone.parse('2016-03-18 10:40:02 UTC') next_run_at = job1.next_run_at_calculate(time_now) 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) 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') next_run_at = job1.next_run_at_calculate(time_now) 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.save + job1.save! time_now = Time.zone.parse('2016-03-17 23:59:23 UTC') next_run_at = job1.next_run_at_calculate(time_now) assert_equal('2016-03-18 00:40:00 UTC', next_run_at.to_s)