Skip to content

Commit 2004b28

Browse files
committed
Refactor experiments folder and CI
Update scope of commit Update experiment graphs
1 parent b7fc3d0 commit 2004b28

File tree

79 files changed

+181
-75
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+181
-75
lines changed

.github/workflows/pid_controller_automated_test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,26 @@ jobs:
2525
with:
2626
bundler-cache: true
2727

28-
- name: Update Graphs
28+
- name: Setup Environment
2929
run: |
30+
git add .
31+
git reset --hard
3032
bundle install
3133
bundle exec rake compile
3234
cd experiments
3335
bundle install
34-
bundle exec ruby example_with_circuit_breaker.rb
36+
37+
- name: Run Experiments
38+
run: |
39+
cd experiments
40+
bundle exec ruby run_all_tests.rb
3541
3642
- name: Commit Graphs
3743
run: |
3844
git checkout ${{ github.head_ref }}
3945
git config user.name shopify-actions
4046
git config user.email shopify-actions@users.noreply.github.com
41-
git add experiments/*.png
47+
git add experiments/results
4248
if git diff --staged --quiet; then
4349
echo "No changes to commit"
4450
else
Binary file not shown.
Binary file not shown.

experiments/example_with_circuit_breaker.rb renamed to experiments/example/example_with_circuit_breaker.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# frozen_string_literal: true
22

3-
$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
3+
$LOAD_PATH.unshift(File.expand_path("../../lib", __dir__))
44

55
require "semian"
6-
require_relative "mock_service"
7-
require_relative "experimental_resource"
6+
require_relative "../mock_service"
7+
require_relative "../experimental_resource"
88

99
# Create the mock service
1010
service = Semian::Experiments::MockService.new(
@@ -88,6 +88,6 @@
8888
graph.data("Circuit Open", outcomes.map { |_, data| data[:circuit_open] })
8989
graph.data("Error", outcomes.map { |_, data| data[:error] })
9090

91-
graph.write("example_output.png")
91+
graph.write(File.join(File.dirname(__FILE__), "example_output.png"))
9292

93-
puts "Graph saved to outcomes.png"
93+
puts "Graph saved to example_output.png"

experiments/gradual_increase.png

-239 KB
Binary file not shown.
-217 KB
Binary file not shown.
-611 KB
Binary file not shown.
Binary file not shown.

experiments/oscillating_errors.png

-208 KB
Binary file not shown.

0 commit comments

Comments
 (0)