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

Runtime Tests in Pipeline #123

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
35 changes: 34 additions & 1 deletion concourse/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@ resources:
branch: main
private_key: ((github-ssh-key))

- name: testtools
type: git
icon: github
source:
uri: [email protected]:fauna/testools.git
branch: main
private_key: ((github-ssh-key))

groups:
- name: standard-release
jobs:
- set-self
- validate
- release

jobs:
Expand All @@ -36,17 +45,32 @@ jobs:
- set_pipeline: self
file: fauna-js-repository/concourse/pipeline.yml

- name: release
- name: validate
serial: true
public: false
plan:
- get: fauna-js-repository
trigger: true
passed:
- set-self

- get: testtools

- task: integration-tests
file: fauna-js-repository/concourse/tasks/integration-tests.yml
privileged: true

- task: runtime-validation
file: fauna-js-repository/concourse/tasks/runtime-validation.yml
params:
AWS_LAMBDA_ROLE_ARN: arn:aws:iam::424964496154:role/driver-test-lambda-role-0cc3197
AWS_ACCESS_KEY_ID: ((runtime-validation-aws.aws-access-key-id.value))
AWS_SECRET_ACCESS_KEY: ((runtime-validation-aws.aws-secret-key.value))
CLOUDFLARE_API_TOKEN: ((runtime-validation.CLOUDFLARE_API_TOKEN))
FAUNA_SECRET: ((runtime-validation.FAUNA_SECRET))
NETLIFY_ACCOUNT: ((runtime-validation.NETLIFY_ACCOUNT))
NETLIFY_AUTH_TOKEN: ((runtime-validation.NETLIFY_AUTH_TOKEN))
VERCEL_TOKEN: ((runtime-validation.VERCEL_TOKEN))
on_success:
put: notify
params:
Expand All @@ -56,6 +80,15 @@ jobs:
params:
text: fauna-js driver release failed integration tests

- name: release
serial: true
public: false
plan:
- get: fauna-js-repository
trigger: false
passed:
- validate

- task: publish
file: fauna-js-repository/concourse/tasks/npm-publish.yml
params:
Expand Down
12 changes: 12 additions & 0 deletions concourse/scripts/runtime-validation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -eou pipefail

cd testtools/fauna-driver-platform-tests

yarn add node-gyp@latest

yarn js:aws-lambda:deploy && yarn js:aws-lambda:deploy
yarn js:cloudflare:deploy && yarn js:cloudflare:deploy
yarn js:netlify:deploy && yarn js:netlify:deploy
yarn js:vercel:deploy && yarn js:vercel:deploy

26 changes: 26 additions & 0 deletions concourse/tasks/runtime-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
platform: linux

image_resource:
type: docker-image
source:
repository: node
tag: 19.8-alpine3.16

params:
AWS_LAMBDA_ROLE_ARN:
AWS_ACCESS_KEY_ID:
AWS_SECRET_ACCESS_KEY:
CLOUDFLARE_API_TOKEN:
FAUNA_SECRET:
NETLIFY_ACCOUNT:
NETLIFY_AUTH_TOKEN:
VERCEL_TOKEN:

inputs:
- name: fauna-js-repository
- name: testtools/fauna-driver-platform-tests

run:
path: ./fauna-js-repository/concourse/scripts/runtime-validation.sh