From d18e55ec8eb4d50a264396686df1796cdc720787 Mon Sep 17 00:00:00 2001 From: sue445 Date: Sun, 21 Jan 2024 09:15:54 +0900 Subject: [PATCH 1/2] Add integration test --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b7bf72..18cad20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,18 @@ jobs: - run: bundle exec rspec - run: bundle exec functions-framework-ruby --verify --verbose --target regional-rb-calendar + - name: Integration test + run: | + set -xe + bundle exec functions-framework-ruby --target regional-rb-calendar & + + # Check status code + curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/api/calendar/connpass.ics | grep "200" + curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/api/calendar/doorkeeper.ics | grep "200" + + pid=$(jobs -l | grep functions-framework-ruby | awk '{print $2}') + kill -9 $pid + - name: Slack Notification uses: lazy-actions/slatify@master if: always() From 28b3d0f769ed5dc5107b66a9096712c5045c04bb Mon Sep 17 00:00:00 2001 From: sue445 Date: Sun, 21 Jan 2024 09:33:04 +0900 Subject: [PATCH 2/2] Add sleep --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18cad20..ba00833 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,9 @@ jobs: run: | set -xe bundle exec functions-framework-ruby --target regional-rb-calendar & + + # FIXME: Wait for booting + sleep 3 # Check status code curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/api/calendar/connpass.ics | grep "200"