DEV: Remove the remaining Travis code (#13255)
The second attempt at #10041 now that all our plugins use GitHub Actions CI instead.
This commit is contained in:
parent
4a7c043382
commit
3bb765ac92
|
@ -59,9 +59,9 @@ desc 'Run all tests (JS and code in a standalone environment)'
|
||||||
task 'docker:test' do
|
task 'docker:test' do
|
||||||
begin
|
begin
|
||||||
@good = true
|
@good = true
|
||||||
|
|
||||||
unless ENV['SKIP_LINT']
|
unless ENV['SKIP_LINT']
|
||||||
@good &&= run_or_fail("yarn install")
|
@good &&= run_or_fail("yarn install")
|
||||||
puts "travis_fold:start:lint" if ENV["TRAVIS"]
|
|
||||||
puts "Running linters/prettyfiers"
|
puts "Running linters/prettyfiers"
|
||||||
puts "eslint #{`yarn eslint -v`}"
|
puts "eslint #{`yarn eslint -v`}"
|
||||||
puts "prettier #{`yarn prettier -v`}"
|
puts "prettier #{`yarn prettier -v`}"
|
||||||
|
@ -94,11 +94,9 @@ task 'docker:test' do
|
||||||
@good &&= run_or_fail('yarn prettier --list-different "plugins/**/assets/stylesheets/**/*.scss" "plugins/**/assets/javascripts/**/*.{js,es6}"')
|
@good &&= run_or_fail('yarn prettier --list-different "plugins/**/assets/stylesheets/**/*.scss" "plugins/**/assets/javascripts/**/*.{js,es6}"')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
puts "travis_fold:end:lint" if ENV["TRAVIS"]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
unless ENV['SKIP_TESTS']
|
unless ENV['SKIP_TESTS']
|
||||||
puts "travis_fold:start:prepare_tests" if ENV["TRAVIS"]
|
|
||||||
puts "Cleaning up old test tmp data in tmp/test_data"
|
puts "Cleaning up old test tmp data in tmp/test_data"
|
||||||
`rm -fr tmp/test_data && mkdir -p tmp/test_data/redis && mkdir tmp/test_data/pg`
|
`rm -fr tmp/test_data && mkdir -p tmp/test_data/redis && mkdir tmp/test_data/pg`
|
||||||
|
|
||||||
|
@ -156,11 +154,7 @@ task 'docker:test' do
|
||||||
@good &&= run_or_fail("#{command_prefix}bundle exec rake parallel:migrate")
|
@good &&= run_or_fail("#{command_prefix}bundle exec rake parallel:migrate")
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "travis_fold:end:prepare_tests" if ENV["TRAVIS"]
|
|
||||||
|
|
||||||
unless ENV["JS_ONLY"]
|
unless ENV["JS_ONLY"]
|
||||||
puts "travis_fold:start:ruby_tests" if ENV["TRAVIS"]
|
|
||||||
|
|
||||||
if ENV['WARMUP_TMP_FOLDER']
|
if ENV['WARMUP_TMP_FOLDER']
|
||||||
run_or_fail('bundle exec rspec ./spec/requests/groups_controller_spec.rb')
|
run_or_fail('bundle exec rspec ./spec/requests/groups_controller_spec.rb')
|
||||||
end
|
end
|
||||||
|
@ -211,13 +205,11 @@ task 'docker:test' do
|
||||||
@good &&= run_or_fail("#{fail_fast} bundle exec rake plugin:spec")
|
@good &&= run_or_fail("#{fail_fast} bundle exec rake plugin:spec")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
puts "travis_fold:end:ruby_tests" if ENV["TRAVIS"]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
unless ENV["RUBY_ONLY"]
|
unless ENV["RUBY_ONLY"]
|
||||||
js_timeout = ENV["JS_TIMEOUT"].presence || 900_000 # 15 minutes
|
js_timeout = ENV["JS_TIMEOUT"].presence || 900_000 # 15 minutes
|
||||||
|
|
||||||
puts "travis_fold:start:js_tests" if ENV["TRAVIS"]
|
|
||||||
unless ENV["SKIP_CORE"]
|
unless ENV["SKIP_CORE"]
|
||||||
@good &&= run_or_fail("bundle exec rake qunit:test['#{js_timeout}']")
|
@good &&= run_or_fail("bundle exec rake qunit:test['#{js_timeout}']")
|
||||||
@good &&= run_or_fail("bundle exec rake qunit:test['#{js_timeout}','/wizard/qunit']")
|
@good &&= run_or_fail("bundle exec rake qunit:test['#{js_timeout}','/wizard/qunit']")
|
||||||
|
@ -237,13 +229,9 @@ task 'docker:test' do
|
||||||
@good &&= run_or_fail("yarn ember test")
|
@good &&= run_or_fail("yarn ember test")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "travis_fold:end:js_tests" if ENV["TRAVIS"]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ensure
|
ensure
|
||||||
puts "travis_fold:start:terminating" if ENV["TRAVIS"]
|
|
||||||
puts "Terminating"
|
puts "Terminating"
|
||||||
|
|
||||||
if ENV['PAUSE_ON_TERMINATE']
|
if ENV['PAUSE_ON_TERMINATE']
|
||||||
|
@ -255,11 +243,7 @@ task 'docker:test' do
|
||||||
Process.kill("TERM", @pg_pid) if @pg_pid
|
Process.kill("TERM", @pg_pid) if @pg_pid
|
||||||
Process.wait @redis_pid if @redis_pid
|
Process.wait @redis_pid if @redis_pid
|
||||||
Process.wait @pg_pid if @pg_pid
|
Process.wait @pg_pid if @pg_pid
|
||||||
puts "travis_fold:end:terminating" if ENV["TRAVIS"]
|
|
||||||
end
|
|
||||||
|
|
||||||
if !@good
|
|
||||||
exit 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
exit 1 unless @good
|
||||||
end
|
end
|
||||||
|
|
|
@ -96,17 +96,7 @@ task "qunit:test", [:timeout, :qunit_path] do |_, args|
|
||||||
puts "Rails server is warmed up"
|
puts "Rails server is warmed up"
|
||||||
|
|
||||||
sh(cmd)
|
sh(cmd)
|
||||||
|
|
||||||
# A bit of a hack until we can figure this out on Travis
|
|
||||||
tries = 0
|
|
||||||
while tries < 3 && $?.exitstatus == 124
|
|
||||||
tries += 1
|
|
||||||
puts "\nTimed Out. Trying again...\n"
|
|
||||||
sh(cmd)
|
|
||||||
end
|
|
||||||
|
|
||||||
success &&= $?.success?
|
success &&= $?.success?
|
||||||
|
|
||||||
ensure
|
ensure
|
||||||
# was having issues with HUP
|
# was having issues with HUP
|
||||||
Process.kill "-KILL", pid
|
Process.kill "-KILL", pid
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
# => RUN_SMOKE_TESTS executes the smoke tests instead of the regular tests from docker.rake
|
# => RUN_SMOKE_TESTS executes the smoke tests instead of the regular tests from docker.rake
|
||||||
# See lib/tasks/docker.rake and lib/tasks/smoke_test.rake for more information
|
# See lib/tasks/docker.rake and lib/tasks/smoke_test.rake for more information
|
||||||
|
|
||||||
puts "travis_fold:end:starting_docker_container" if ENV["TRAVIS"]
|
|
||||||
|
|
||||||
def log(message)
|
def log(message)
|
||||||
puts "[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] #{message}"
|
puts "[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] #{message}"
|
||||||
end
|
end
|
||||||
|
@ -22,24 +20,17 @@ def run_or_fail(command)
|
||||||
end
|
end
|
||||||
|
|
||||||
unless ENV['NO_UPDATE']
|
unless ENV['NO_UPDATE']
|
||||||
puts "travis_fold:start:pulling_latest_discourse" if ENV["TRAVIS"]
|
|
||||||
|
|
||||||
run_or_fail("git reset --hard")
|
run_or_fail("git reset --hard")
|
||||||
|
|
||||||
run_or_fail("git fetch")
|
run_or_fail("git fetch")
|
||||||
|
|
||||||
checkout = ENV['COMMIT_HASH'] || "FETCH_HEAD"
|
checkout = ENV['COMMIT_HASH'] || "FETCH_HEAD"
|
||||||
run_or_fail("LEFTHOOK=0 git checkout #{checkout}")
|
run_or_fail("LEFTHOOK=0 git checkout #{checkout}")
|
||||||
|
|
||||||
puts "travis_fold:end:pulling_latest_discourse" if ENV["TRAVIS"]
|
|
||||||
puts "travis_fold:start:bundle" if ENV["TRAVIS"]
|
|
||||||
|
|
||||||
run_or_fail("bundle")
|
run_or_fail("bundle")
|
||||||
|
|
||||||
puts "travis_fold:end:bundle" if ENV["TRAVIS"]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
log("Running tests")
|
log("Running tests")
|
||||||
|
|
||||||
if ENV['RUN_SMOKE_TESTS']
|
if ENV['RUN_SMOKE_TESTS']
|
||||||
run_or_fail("bundle exec rake smoke:test")
|
run_or_fail("bundle exec rake smoke:test")
|
||||||
else
|
else
|
||||||
|
|
|
@ -6,7 +6,6 @@ describe OptimizedImage do
|
||||||
let(:upload) { build(:upload) }
|
let(:upload) { build(:upload) }
|
||||||
before { upload.id = 42 }
|
before { upload.id = 42 }
|
||||||
|
|
||||||
unless ENV["TRAVIS"]
|
|
||||||
describe '.crop' do
|
describe '.crop' do
|
||||||
it 'should produce cropped images (requires ImageMagick 7)' do
|
it 'should produce cropped images (requires ImageMagick 7)' do
|
||||||
tmp_path = "/tmp/cropped.png"
|
tmp_path = "/tmp/cropped.png"
|
||||||
|
@ -32,7 +31,6 @@ describe OptimizedImage do
|
||||||
File.delete(tmp_path) if File.exists?(tmp_path)
|
File.delete(tmp_path) if File.exists?(tmp_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
describe ".resize_instructions" do
|
describe ".resize_instructions" do
|
||||||
let(:image) { "#{Rails.root}/spec/fixtures/images/logo.png" }
|
let(:image) { "#{Rails.root}/spec/fixtures/images/logo.png" }
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe UserAvatarsController do
|
describe UserAvatarsController do
|
||||||
|
|
||||||
context 'show_proxy_letter' do
|
context 'show_proxy_letter' do
|
||||||
it 'returns not found if external avatar is set somewhere else' do
|
it 'returns not found if external avatar is set somewhere else' do
|
||||||
SiteSetting.external_system_avatars_url = "https://somewhere.else.com/avatar.png"
|
SiteSetting.external_system_avatars_url = "https://somewhere.else.com/avatar.png"
|
||||||
|
@ -19,9 +18,6 @@ describe UserAvatarsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'show' do
|
context 'show' do
|
||||||
|
|
||||||
# travis is not good here, no image magick
|
|
||||||
if !ENV["TRAVIS"]
|
|
||||||
context 'invalid' do
|
context 'invalid' do
|
||||||
after do
|
after do
|
||||||
FileUtils.rm(Discourse.store.path_for(upload))
|
FileUtils.rm(Discourse.store.path_for(upload))
|
||||||
|
@ -36,7 +32,7 @@ describe UserAvatarsController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
let :user do
|
let(:user) do
|
||||||
user = Fabricate(:user)
|
user = Fabricate(:user)
|
||||||
user.user_avatar.update_columns(custom_upload_id: upload.id)
|
user.user_avatar.update_columns(custom_upload_id: upload.id)
|
||||||
user.update_columns(uploaded_avatar_id: upload.id)
|
user.update_columns(uploaded_avatar_id: upload.id)
|
||||||
|
@ -66,7 +62,6 @@ describe UserAvatarsController do
|
||||||
expect(upload.extension).to eq('png')
|
expect(upload.extension).to eq('png')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
it 'handles non local content correctly' do
|
it 'handles non local content correctly' do
|
||||||
setup_s3
|
setup_s3
|
||||||
|
|
Loading…
Reference in New Issue