mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Optimisations to docker test script
This commit is contained in:
parent
a3e3de4735
commit
0c2d346455
@ -9,14 +9,16 @@ desc 'Run all tests (JS and code in a standalone environment)'
|
|||||||
task 'docker:test' do
|
task 'docker:test' do
|
||||||
begin
|
begin
|
||||||
|
|
||||||
exit 1 unless run_or_fail("git remote update")
|
unless ENV['NO_UPDATE']
|
||||||
|
exit 1 unless run_or_fail("git remote update")
|
||||||
|
|
||||||
checkout = "master"
|
checkout = "master"
|
||||||
if hash = ENV['COMMIT_HASH']
|
if hash = ENV['COMMIT_HASH']
|
||||||
checkout = hash
|
checkout = hash
|
||||||
|
end
|
||||||
|
exit 1 unless run_or_fail("git checkout #{checkout}")
|
||||||
|
exit 1 unless run_or_fail("bundle")
|
||||||
end
|
end
|
||||||
exit 1 unless run_or_fail("git checkout #{checkout}")
|
|
||||||
exit 1 unless run_or_fail("bundle")
|
|
||||||
|
|
||||||
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`
|
||||||
@ -27,6 +29,12 @@ task 'docker:test' do
|
|||||||
@postgres_bin = "/usr/lib/postgresql/9.3/bin/"
|
@postgres_bin = "/usr/lib/postgresql/9.3/bin/"
|
||||||
`#{@postgres_bin}initdb -D tmp/test_data/pg`
|
`#{@postgres_bin}initdb -D tmp/test_data/pg`
|
||||||
|
|
||||||
|
# speed up db, never do this in production mmmmk
|
||||||
|
`echo fsync = off >> tmp/test_data/pg/postgresql.conf`
|
||||||
|
`echo full_page_writes = off >> tmp/test_data/pg/postgresql.conf`
|
||||||
|
`echo shared_buffers = 500MB >> tmp/test_data/pg/postgresql.conf`
|
||||||
|
|
||||||
|
|
||||||
puts "Starting postgres"
|
puts "Starting postgres"
|
||||||
@pg_pid = Process.spawn("#{@postgres_bin}postmaster -D tmp/test_data/pg")
|
@pg_pid = Process.spawn("#{@postgres_bin}postmaster -D tmp/test_data/pg")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user