-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
548 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: e2e test | ||
on: [push] | ||
env: | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
SERVICE_ACCOUNT_JSON: ${{ secrets.REVIEW_SERVICE_ACCOUNT_JSON }} | ||
GCP_SERVICE_ACCOUNT_JSON: ${{ secrets.REVIEW_GCP_SERVICE_ACCOUNT_JSON }} | ||
APP_LOCAL_EMV: ${{ secrets.APP_LOCAL_EMV }} | ||
ENVENB_GO: ${{ secrets.ENVENB_GO }} | ||
AUTH_CONFIG: ${{ secrets.AUTH_CONFIG }} | ||
jobs: | ||
e2e: | ||
name: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Create serviceAccount.json file | ||
run: echo $SERVICE_ACCOUNT_JSON | base64 --decode -i > ./serviceAccount.json | ||
- name: Create gcpServiceAccount.json file | ||
run: echo $GCP_SERVICE_ACCOUNT_JSON | base64 --decode -i > ./gcpServiceAccount.json | ||
- name: Create .env file | ||
run: echo $APP_LOCAL_EMV | base64 --decode -i > ./.env | ||
- name: Create envenb.go file | ||
run: echo $ENVENB_GO | base64 --decode -i > ./envenb.go | ||
- name: Create e2e/.env file | ||
run: echo $AUTH_CONFIG | base64 --decode -i > ./e2e/.env | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.16' | ||
- run: go version | ||
- name: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-memoir-backend-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-memoir-backend- | ||
- name: Run server | ||
run: make ci_setup_server | ||
- name: create auth token file | ||
run: make create_login_yaml | ||
working-directory: ./e2e | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
- name: setup gcloud | ||
uses: google-github-actions/setup-gcloud@master | ||
with: | ||
version: "latest" | ||
- name: setup firestore emulator | ||
run: | | ||
gcloud components install beta --quiet | ||
gcloud components install cloud-firestore-emulator --quiet | ||
- name: setup e2e | ||
run: | | ||
gcloud beta emulators firestore start --host-port localhost:3600 & | ||
go install github.com/zoncoen/scenarigo/cmd/scenarigo@v0.8.1 | ||
working-directory: ./e2e | ||
- name: run e2e | ||
run: make scenarigo | ||
working-directory: ./e2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.15.5 | ||
1.16.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
.PHONY: moqgen | ||
moqgen: | ||
@-rm -f ./repository/moqs/*.go | ||
go generate ./repository/... | ||
go generate ./repository/... | ||
.PHONY: ci_setup_server | ||
ci_setup_server: | ||
FIRESTORE_EMULATOR_HOST=localhost:3600 go run app.go & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.PHONY: create_loggin_yaml | ||
create_login_yaml: | ||
go run script/main.go | ||
.PHONY: scenarigo | ||
scenarigo: | ||
HOST=localhost:8080 scenarigo run | ||
.PHONY: local_scenarigo | ||
local_scenarigo: | ||
npx firebase --config ./simulator/firebase.json emulators:exec 'HOST=localhost:8080 scenarigo run' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
title: アイテム | ||
steps: | ||
- title: login | ||
include: './login.yaml' | ||
bind: | ||
vars: | ||
userToken: "{{vars.userToken}}" | ||
- title: アイテムを作成する① | ||
bind: | ||
vars: | ||
itemID: "{{response.data.createItem.id}}" | ||
protocol: http | ||
request: | ||
method: POST | ||
url: "http://{{env.HOST}}/query" | ||
header: | ||
Authorization: "Bearer {{vars.userToken}}" | ||
Content-Type: application/json | ||
body: | ||
query: |- | ||
mutation CreateItem($input: NewItem!) { | ||
createItem(input: $input) { | ||
id | ||
title | ||
date | ||
categoryID | ||
like | ||
dislike | ||
createdAt | ||
updatedAt | ||
} | ||
} | ||
variables: | ||
input: | ||
title: 散歩に行った | ||
categoryID: 1 | ||
date: 2021-01-01T00:00:00+09:00 | ||
like: true | ||
dislike: false | ||
|
||
- title: アイテムを取得する | ||
protocol: http | ||
request: | ||
method: POST | ||
url: "http://{{env.HOST}}/query" | ||
header: | ||
Authorization: "Bearer {{vars.userToken}}" | ||
Content-Type: application/json | ||
body: | ||
query: |- | ||
query Item($id: ID!) { | ||
item(id: $id) { | ||
id | ||
title | ||
categoryID | ||
date | ||
like | ||
dislike | ||
} | ||
} | ||
variables: | ||
id: "{{vars.itemID}}" | ||
expect: | ||
body: | ||
data: | ||
item: | ||
id: "{{vars.itemID}}" | ||
title: 散歩に行った | ||
categoryID: 1 | ||
date: 2021-01-01T00:00:00+09:00 | ||
like: true | ||
dislike: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
schemaVersion: config/v1 | ||
|
||
scenarios: | ||
- user.yaml | ||
- item.yaml |
Oops, something went wrong.