From 15d91f9056746648d60777fb1ebb609d93e4556f Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:56:14 -0400 Subject: [PATCH] SWI-5458 Update Call Cleanup and Test WF (#139) * SWI-5458 Update Call Cleanup and Test WF * remove spaces * move allow * move again * spaces * why is this not updating * is it updating * check out the right branch :facepalm: --- .../workflows/{test-nightly.yml => test-smoke.yml} | 11 +++++++---- spec/call_utils.rb | 2 +- spec/smoke/calls_api_spec.rb | 2 +- spec/spec_helper.rb | 4 +++- spec/unit/client/api_client_spec.rb | 4 ++-- 5 files changed, 14 insertions(+), 9 deletions(-) rename .github/workflows/{test-nightly.yml => test-smoke.yml} (93%) diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-smoke.yml similarity index 93% rename from .github/workflows/test-nightly.yml rename to .github/workflows/test-smoke.yml index 2b7fe80b..d00d9e69 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-smoke.yml @@ -1,8 +1,13 @@ -name: Nightly Smoke Tests +name: Smoke Test on: schedule: - cron: "0 4 * * *" + pull_request: + branches: + - main + paths: + - "spec/smoke/*" concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} @@ -26,13 +31,11 @@ env: jobs: test_main: - name: Nightly Smoke Test + name: Smoke Test runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: "main" - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/spec/call_utils.rb b/spec/call_utils.rb index d1ff4131..9832aad7 100644 --- a/spec/call_utils.rb +++ b/spec/call_utils.rb @@ -1,4 +1,4 @@ -# Helper functions for voice calls +# Helper functions for voice calls # These are reused in multiple tests def setup_manteca(type) diff --git a/spec/smoke/calls_api_spec.rb b/spec/smoke/calls_api_spec.rb index b4813a46..74ebeb04 100644 --- a/spec/smoke/calls_api_spec.rb +++ b/spec/smoke/calls_api_spec.rb @@ -116,7 +116,7 @@ # Update Call describe 'update_call' do - it 'creates and updates a call' do + it 'creates and updates a call' do update_call_body = Bandwidth::UpdateCall.new( state: Bandwidth::CallStateEnum::ACTIVE, redirect_url: MANTECA_BASE_URL + '/bxml/pause' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3076a06d..b3744e59 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,7 +9,7 @@ else !(['/models/call_state_enum.rb', '/models/call_state.rb', - '/models/deferred_result.rb', + '/models/deferred_result.rb', '/models/message.rb', '/models/verify_code_request.rb' ].any? { |name| source_file.filename.include?(name) }) @@ -89,7 +89,9 @@ config.password = BW_PASSWORD end calls_api = Bandwidth::CallsApi.new + WebMock.allow_net_connect! cleanup_calls($active_calls, calls_api) + WebMock.disable_net_connect! } # rspec-expectations config goes here. You can use an alternate diff --git a/spec/unit/client/api_client_spec.rb b/spec/unit/client/api_client_spec.rb index 2cd1ef0a..9f88e4aa 100644 --- a/spec/unit/client/api_client_spec.rb +++ b/spec/unit/client/api_client_spec.rb @@ -369,8 +369,8 @@ expect(api_client_default.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") expect(api_client_default.build_collection_param(param, :pipes)).to eq('aa|bb|cc') expect(api_client_default.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) - expect { - api_client_default.build_collection_param(param, :INVALID) + expect { + api_client_default.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') end end