Skip to content

Commit cca4c55

Browse files
committed
Set up automated test for PID controller
Reset Update experiment graphs Delete existing image Done Update experiment graphs Update experiment graphs Refactor experiments folder and CI Update scope of commit Update experiment graphs Update experiment graphs Update Gemfile Update experiment graphs Move windup file into test folder Update experiment graphs CI should only commit main graphs Update experiment graphs
1 parent dac8441 commit cca4c55

File tree

83 files changed

+255
-97
lines changed

Some content is hidden

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

83 files changed

+255
-97
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: "PID Controller Automated Test"
3+
4+
# yamllint disable-line rule:truthy
5+
on:
6+
pull_request:
7+
types: [opened, reopened, synchronize]
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
pid-controller-automated-test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Install dependencies
18+
run: |
19+
sudo apt-get update && sudo apt-get install -y build-essential libssl-dev libmysqlclient-dev imagemagick libmagickwand-dev
20+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
with:
22+
ref: ${{ github.event.pull_request.head.sha }}
23+
fetch-depth: 0
24+
- uses: ruby/setup-ruby@0481980f17b760ef6bca5e8c55809102a0af1e5a # v1.263.0
25+
with:
26+
bundler-cache: true
27+
28+
- name: Setup Environment
29+
run: |
30+
git add .
31+
git reset --hard
32+
bundle install
33+
bundle exec rake compile
34+
cd experiments
35+
bundle install
36+
37+
- name: Run Experiments
38+
run: |
39+
cd experiments
40+
bundle exec ruby run_all_tests.rb
41+
42+
- name: Commit Graphs
43+
run: |
44+
git checkout ${{ github.head_ref }}
45+
git config user.name shopify-actions
46+
git config user.email shopify-actions@users.noreply.github.com
47+
git add experiments/results/main_graphs
48+
if git diff --staged --quiet; then
49+
echo "No changes to commit"
50+
else
51+
git commit -m "Update experiment graphs"
52+
git push
53+
fi
54+
Binary file not shown.
Binary file not shown.
67.1 KB

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/example_output.png

-81.3 KB
Binary file not shown.

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.

0 commit comments

Comments
 (0)