Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use maze-runner to trigger stress test #1040

Merged
merged 7 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,13 @@ steps:
timeout_in_minutes: 3
agents:
queue: opensource-mac-cocoa
env:
STRESS_TEST: "true"
commands:
- cd features/fixtures/macos-stress-test && make build run
- bundle install
- bundle exec maze-runner
features/stress_test.feature
--no-log-requests
artifact_paths:
- features/fixtures/macos-stress-test/BugsnagStressTest.stdout.log
- features/fixtures/macos-stress-test/BugsnagStressTest.stderr.log
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem 'xcpretty'

# A reference to Maze Runner is only needed for running tests locally and if committed it must be
# portable for CI, e.g. a specific release. However, leaving it commented out would mean quicker CI.
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v4.11.1'
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v4.13.0'

# Locally, you can run against Maze Runner branches and uncommitted changes:
# gem 'bugsnag-maze-runner', path: '../maze-runner'
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/bugsnag/maze-runner
revision: b5925737b0c3db49ac38a5a68e6bfe38026ef508
tag: v4.11.1
revision: 3161e2a7115a2642a1929aa5c037ead65d4ebfba
tag: v4.13.0
specs:
bugsnag-maze-runner (4.11.1)
bugsnag-maze-runner (4.13.0)
appium_lib (~> 11.2.0)
boring (~> 0.1.0)
cucumber (~> 3.1.2)
Expand Down Expand Up @@ -35,7 +35,7 @@ GEM
appium_lib_core (~> 4.1)
nokogiri (~> 1.8, >= 1.8.1)
tomlrb (~> 1.1)
appium_lib_core (4.4.1)
appium_lib_core (4.5.0)
faye-websocket (~> 0.11.0)
selenium-webdriver (~> 3.14, >= 3.14.1)
atomos (0.1.3)
Expand Down Expand Up @@ -170,7 +170,7 @@ GEM
nap (1.1.0)
netrc (0.11.0)
no_proxy_fix (0.1.2)
nokogiri (1.11.1)
nokogiri (1.11.2)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
octokit (4.20.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import <mach/task.h>
#import <mach/task_info.h>

static NSString * const kNotifyEndpoint = @"http://bs-local.com:9339/notify";
static NSString * const kNotifyEndpoint = @"http://localhost:9339/notify";

static const int kNumberOfIterations = 5000;

Expand Down
1 change: 1 addition & 0 deletions features/fixtures/macos-stress-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ run:
rm -rf $(HOME)/Library/Application\ Support/com.bugsnag.Bugsnag
QUIET=true /usr/bin/time -l ./build/usr/local/bin/BugsnagStressTest
rm -rf $(HOME)/Library/Application\ Support/com.bugsnag.Bugsnag
echo "macOS stress-test complete"
12 changes: 12 additions & 0 deletions features/stress_test.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@stress_test
Feature: Stress test

Scenario: Triggering error notifications continuously
When I start a new shell
And I input "cd features/fixtures/macos-stress-test" interactively
And I input "make build run" interactively
And I wait for the shell to output "macOS stress-test complete" to stdout
Then the last interactive command exited successfully

# This is low, but due to network congestion all we can guarantee in the course of a normal test
And I have received at least 1 error
8 changes: 8 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@

AfterConfiguration do |_config|
Maze.config.receive_no_requests_wait = 15

# Setup a 3 minute timeout for receiving requests is STRESS_TEST env var is set
Maze.config.receive_requests_wait = 180 unless ENV['STRESS_TEST'].nil?
end

# Skip stress tests unless STRESS_TEST env var is set
Before('@stress_test') do |_scenario|
skip_this_scenario('Skipping: Run is not configured for stress tests') if ENV['STRESS_TEST'].nil?
end

# Additional require MacOS configuration
Expand Down