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

Move AWS lambda tests from MacOS/Buildkite to GHA #2339

Merged
merged 10 commits into from
Feb 19, 2025
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
21 changes: 0 additions & 21 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,6 @@ steps:
- exit_status: "*"
limit: 1

- label: ":aws-lambda: AWS Lambda tests"
timeout_in_minutes: 35
agents:
queue: "macos-14"
env:
NODE_VERSION: "18"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
plugins:
test-collector#v1.10.2:
files: "test/aws-lambda/reports/TEST-*.xml"
format: "junit"
branch: "^main|next$$"
api-token-env-name: "JS_AWS_LAMBDA_BUILDKITE_ANALYTICS_TOKEN"
commands:
# force the NPM registry as the default on CI is artifactory, which can't
# currently install from our lockfile
- npm ci --registry https://registry.npmjs.org
- cd test/aws-lambda
- bundle install
- bundle exec maze-runner

#
# Core tests and checks
#
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/aws-lambda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: AWS Lambda tests

permissions: read-all

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Install libcurl4-openssl-dev and net-tools
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install net-tools

- run: sam --version

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Install Ruby
uses: ruby/setup-ruby@32110d4e311bd8996b2a82bf2a43b714ccc91777
with:
ruby-version: '3.1'

- name: Install Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
with:
node-version: 18

- name: Run tests
run: |
cd test/aws-lambda
bundle install
bundle exec maze-runner
2 changes: 1 addition & 1 deletion test/aws-lambda/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
gem 'bugsnag-maze-runner', '~>9.0'

# Use a branch of Maze Runner
#gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'tms/use-maze-check'
# gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'tms/use-maze-check'

# Locally, you can run against Maze Runner branches and uncommitted changes:
#gem 'bugsnag-maze-runner', path: '../../../maze-runner'
10 changes: 8 additions & 2 deletions test/aws-lambda/features/steps/aws-lambda-steps.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Given('I setup the environment') do
if ENV['NETWORK_NAME']
host_name = 'host.docker.internal'
else
# Use the default for docker bridge host
host_name = '172.17.0.1'
end
steps %Q{
Given I store the api key in the environment variable "BUGSNAG_API_KEY"
And I set environment variable "BUGSNAG_NOTIFY_ENDPOINT" to "http://host.docker.internal:9339/notify"
And I set environment variable "BUGSNAG_SESSIONS_ENDPOINT" to "http://host.docker.internal:9339/sessions"
And I set environment variable "BUGSNAG_NOTIFY_ENDPOINT" to "http://#{host_name}:9339/notify"
And I set environment variable "BUGSNAG_SESSIONS_ENDPOINT" to "http://#{host_name}:9339/sessions"
}
end
16 changes: 0 additions & 16 deletions test/aws-lambda/features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
BeforeAll do
`command -v sam`

if $? != 0
puts <<~ERROR
The AWS SAM CLI must be installed before running these tests!

See the installation instructions:
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html

If you have already installed the SAM CLI, check that it's in your PATH:
$ command -v sam
ERROR

exit 127
end

success = system(File.realpath("#{__dir__}/../scripts/build-fixtures"))

unless success
Expand Down