mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:22:45 +08:00
FIX: ruby bench script no longer working
The library used to generate random text changed, this caused the title of the topic used for testing to change, which meant the slug changed, so a hit to the topic was a redirect This fix gives the topic used for performance testing a static name to avoid this issue in future
This commit is contained in:
parent
08f626d351
commit
819d4facda
|
@ -231,7 +231,7 @@ begin
|
|||
tests = [
|
||||
["categories", "/categories"],
|
||||
["home", "/"],
|
||||
["topic", "/t/oh-how-i-wish-i-could-shut-up-like-a-tunnel-for-so/179"]
|
||||
["topic", "/t/i-am-a-topic-used-for-perf-tests/179"]
|
||||
# ["user", "/u/admin1/activity"],
|
||||
]
|
||||
|
||||
|
|
|
@ -62,9 +62,17 @@ unless Rails.env == "profile"
|
|||
exit
|
||||
end
|
||||
|
||||
def ensure_perf_test_topic_has_right_title!
|
||||
t = Topic.find(179)
|
||||
t.title = "I am a topic used for perf tests"
|
||||
t.save! if t.title_changed?
|
||||
end
|
||||
|
||||
# by default, Discourse has a "system" and `discobot` account
|
||||
if User.count > 2
|
||||
puts "Only run this script against an empty DB"
|
||||
|
||||
ensure_perf_test_topic_has_right_title!
|
||||
exit
|
||||
end
|
||||
|
||||
|
@ -110,3 +118,5 @@ end
|
|||
# no sidekiq so update some stuff
|
||||
Category.update_stats
|
||||
Jobs::PeriodicalUpdates.new.execute(nil)
|
||||
|
||||
ensure_perf_test_topic_has_right_title!
|
||||
|
|
Loading…
Reference in New Issue
Block a user