mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Fix bugs in profiling scripts leading to incorrect results.
This commit is contained in:
@ -188,7 +188,7 @@ begin
|
||||
append = "?api_key=#{api_key}&api_username=admin1"
|
||||
|
||||
# asset precompilation is a dog, wget to force it
|
||||
run "wget http://127.0.0.1:#{@port}/ -O /dev/null"
|
||||
run "wget http://127.0.0.1:#{@port}/ -o /dev/null -O /dev/null"
|
||||
|
||||
tests = [
|
||||
["categories", "/categories"],
|
||||
@ -197,7 +197,13 @@ begin
|
||||
# ["user", "/u/admin1/activity"],
|
||||
]
|
||||
|
||||
tests = tests.map { |k, url| ["#{k}_admin", "#{url}#{append}"] } + tests
|
||||
tests.concat(tests.map { |k, url| ["#{k}_admin", "#{url}#{append}"] })
|
||||
|
||||
tests.each do |_, path|
|
||||
if `curl -s -I "http://127.0.0.1:#{@port}#{path}"` !~ /200 OK/
|
||||
raise "#{path} returned non 200 response code"
|
||||
end
|
||||
end
|
||||
|
||||
# NOTE: we run the most expensive page first in the bench
|
||||
|
||||
|
@ -46,10 +46,10 @@ def create_admin(seq)
|
||||
admin.email = "admin@localhost#{seq}.fake"
|
||||
admin.username = "admin#{seq}"
|
||||
admin.password = "password"
|
||||
admin.save
|
||||
admin.save!
|
||||
admin.grant_admin!
|
||||
admin.change_trust_level!(TrustLevel[4])
|
||||
admin.email_tokens.update_all(confirmed: true)
|
||||
admin.activate
|
||||
}
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user