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

Feature/linux e2e tests #91

Merged
merged 2 commits into from
Oct 31, 2019
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
60 changes: 60 additions & 0 deletions .github/workflows/end-to-end-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: End to End Test

on:
schedule:
- cron: '30 3 * * *'

jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '8.0.212'
- name: Setup Env
run: ./scripts/setup.sh ubuntu-18.04
- name: Build Jar
run: ./scripts/compile-maven.sh
- name: Compile Binary
run: ./scripts/build.sh ubuntu-18.04
- name: Upload Binary
uses: actions/upload-artifact@master
with:
name: titan-linux.zip
path: ./titan
test-linux:
name: Test Linux
runs-on: ubuntu-18.04
needs: build-linux
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@master
with:
name: titan-linux.zip
path: ./
- name: Config Git
run: |
git config --global user.name "test.runner"
git config --global user.email "[email protected]"
- name: Install Titan
run: |
chmod +x titan
sudo cp ./titan /usr/local/bin/titan
- name: Install Vexrun
run: |
curl -L https://github.com/mcred/vexrun/releases/download/v0.0.5/vexrun-0.0.5.jar -o vexrun.jar
- name: Run Getting Started Tests
run: java -jar vexrun.jar -d ./src/endtoend-test/getting-started
- name: Run S3 Workflow Tests
run: java -jar vexrun.jar -f ./src/endtoend-test/remotes/s3/s3WorkflowTests.yml
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Run SSH Workflow Tests
run: |
hostname -i >> localip
ssh-keygen -b 2048 -t rsa -f ./sshKey -q -N ""
java -jar vexrun.jar -f ./src/endtoend-test/remotes/ssh/sshWorkflowTests.yml
22 changes: 5 additions & 17 deletions src/endtoend-test/getting-started/GettingStartedTests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
tests:
- "can install titan":
command: titan install
exitValue: 0
wait: 30
wait: 10
stdout:
contains: Titan cli successfully installed, happy data versioning :)
- "can clone hello-world/posrgres":
command: titan clone s3web://demo.titan-data.io/hello-world/postgres hello-world
exitValue: 0
stdout:
contains:
- Running controlled container hello-world
Expand All @@ -18,38 +16,32 @@ tests:
stdout: repository 'hello-world' already exists
- "can list hello-world/postgres":
command: titan ls
exitValue: 0
stdout: |-
REPOSITORY STATUS
hello-world running
- "can get contents of hello-world/postgres":
command: [docker, exec, hello-world, psql, postgres://postgres:postgres@localhost/postgres, -t, -c, SELECT * FROM messages;]
exitValue: 0
stdout: Hello, World!
- "can remove hello-world/postgres":
command: titan rm -f hello-world
exitValue: 0
stdout: |-
Removing container hello-world
Deleting volume hello-world/v0
hello-world removed
- "can run mongo-test":
command: titan run -- --name mongo-test -p 27017:27017 -d mongo:latest
exitValue: 0
wait: 30
wait: 5
stdout: |-
Creating repository mongo-test
Creating docker volume mongo-test/v0 with path /data/configdb
Creating docker volume mongo-test/v1 with path /data/db
Running controlled container mongo-test
- "can insert mongo-test Ada Lovelace":
command: [docker, exec, mongo-test, mongo, --quiet, --eval, 'db.employees.insert({firstName:"Ada",lastName:"Lovelace"})']
exitValue: 0
stdout: |-
WriteResult({ "nInserted" : 1 })
- "can commit mongo-test":
command: [titan, commit, -m, First Employee, mongo-test]
exitValue: 0
stdout:
contains: Commit
env:
Expand All @@ -60,19 +52,16 @@ tests:
replace: ""
- "can insert mongo-test Grace Hopper":
command: [docker, exec, mongo-test, mongo, --quiet, --eval, 'db.employees.insert({firstName:"Grace",lastName:"Hopper"})']
exitValue: 0
stdout: |-
WriteResult({ "nInserted" : 1 })
- "can select employees from mongo-test":
command: [docker, exec, mongo-test, mongo, --quiet, --eval, 'db.employees.find()']
exitValue: 0
stdout:
contains:
- '"firstName" : "Ada", "lastName" : "Lovelace"'
- '"firstName" : "Grace", "lastName" : "Hopper"'
- "can checkout commit mongo-test":
command: [titan, checkout, --commit, $COMMIT_GUID, mongo-test]
exitValue: 0
wait: 10
stdout: |-
Stopping container mongo-test
Expand All @@ -84,19 +73,18 @@ tests:
- COMMIT_GUID
- "mongo-test checkout was successful":
command: [docker, exec, mongo-test, mongo, --quiet, --eval, 'db.employees.find()']
exitValue: 0
stdout:
excludes:
- '"firstName" : "Grace", "lastName" : "Hopper"'
- "can remove mongo-test":
command: titan rm -f mongo-test
exitValue: 0
stdout: |-
Removing container mongo-test
Deleting volume mongo-test/v0
Deleting volume mongo-test/v1
mongo-test removed
- "can uninstall titan":
command: titan uninstall
exitValue: 0
stdout: Uninstalled titan infrastructure
stdout: Uninstalled titan infrastructure
after:
clearVars: true
10 changes: 1 addition & 9 deletions src/endtoend-test/remotes/RemoteWorkflowTests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
tests:
- "$REMOTE > remote > add":
command: titan remote add -r $REMOTE $URI $REPO
exitValue: 0
stdout: ""
env:
get:
- URI
- REPO
- REMOTE
- "$REMOTE > remote > ls > has $REMOTE":
command: titan remote ls $REPO
exitValue: 0
stdout:
contains: $URI
env:
Expand All @@ -20,7 +17,6 @@ tests:
- REMOTE
- "$REMOTE > commit":
command: [titan, commit, -m, Test $REMOTE Commit, $REPO]
exitValue: 0
stdout:
contains: Commit
env:
Expand All @@ -34,7 +30,6 @@ tests:
position: 1
- "$REMOTE > remote > log > missing commit":
command: titan remote log $REPO
exitValue: 0
stdout:
excludes: Commit $COMMIT_GUID
env:
Expand All @@ -44,20 +39,17 @@ tests:
- REMOTE
- "$REMOTE > push":
command: [titan, push, -r, $REMOTE, -c, $COMMIT_GUID, $REPO]
exitValue: 0
stdout:
contains:
- PUSH $COMMIT_GUID to $REMOTE RUNNING
- Pushing $COMMIT_GUID to '$REMOTE'
- PUSH $COMMIT_GUID to $REMOTE COMPLETE
- Push completed successfully
env:
get:
- COMMIT_GUID
- REPO
- REMOTE
- "$REMOTE > remote > log > has commit":
command: titan remote log $REPO
exitValue: 0
stdout:
contains: Commit $COMMIT_GUID
env:
Expand Down
12 changes: 12 additions & 0 deletions src/endtoend-test/remotes/s3/s3Cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tests:
- "remove $REMOTE assets":
command: aws s3 rm $URI
env:
get:
- URI
- REMOTE
- "remove $REPO":
command: titan rm -f $REPO
env:
get:
- REPO
26 changes: 19 additions & 7 deletions src/endtoend-test/remotes/s3/s3WorkflowTests.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
tests:
- "aws configure access_key_id":
command: aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
exitValue: 0
stdout: ""
env:
get:
- AWS_ACCESS_KEY_ID
- "aws configure access_secret_key":
command: aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
exitValue: 0
stdout: ""
env:
get:
- AWS_SECRET_ACCESS_KEY
- "aws configure region":
command: aws configure set region $AWS_REGION
exitValue: 0
stdout: ""
env:
get:
- $AWS_REGION
- AWS_REGION
- "can install titan":
command: titan install
wait: 30
stdout:
contains: Titan cli successfully installed, happy data versioning :)
- "can clone hello-world/posrgres":
command: titan clone s3web://demo.titan-data.io/hello-world/postgres hello-world
stdout:
contains:
- Running controlled container hello-world
- Starting container hello-world
files:
- ../RemoteWorkflowTests.yml:
parameters:
REMOTE: s3
URI: s3://titan-data-testdata/e2etest
REPO: hello-world
- s3Cleanup.yml:
parameters:
REMOTE: s3
URI: s3://titan-data-testdata/e2etest
REPO: hello-world
after:
clearVars: true
26 changes: 13 additions & 13 deletions src/endtoend-test/remotes/ssh/sshWorkflowTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ tests:
- "get ssh test server":
command: docker pull titandata/ssh-test-server:latest
- "start ssh server":
command: docker run -v $PWD:/workdir --workdir /workdir -p 22:22 -d --name sshHost titandata/ssh-test-server:latest
command: docker run -v $PWD:/workdir --workdir /workdir -p 2022:22 -d --name sshHost titandata/ssh-test-server:latest
env:
get:
- PWD
Expand Down Expand Up @@ -30,14 +30,14 @@ tests:
delimiter: " "
position: 1
- "add ssh remote with password succeeds":
command: titan remote add ssh://root:root@$SSH_HOST:22/test sshTest
command: titan remote add ssh://root:root@$SSH_HOST:2022/test sshTest
env:
get:
- SSH_HOST
- "repo has ssh remote with password":
command: titan remote ls sshTest
stdout:
contains: ssh://root:*****@$SSH_HOST:22/test
contains: ssh://root:*****@$SSH_HOST:2022/test
env:
get:
- SSH_HOST
Expand All @@ -51,8 +51,8 @@ tests:
command: titan push sshTest
stdout:
contains:
- PUSH $COMMIT_GUID to origin RUNNING
- PUSH $COMMIT_GUID to origin COMPLETE
- Pushing $COMMIT_GUID to 'origin'
- Push completed successfully
env:
get:
- COMMIT_GUID
Expand Down Expand Up @@ -84,8 +84,8 @@ tests:
command: titan pull sshTest
stdout:
contains:
- PULL $COMMIT_GUID from origin RUNNING
- PULL $COMMIT_GUID from origin COMPLETE
- Pulling $COMMIT_GUID from 'origin'
- Pull completed successfully
env:
get:
- COMMIT_GUID
Expand Down Expand Up @@ -117,15 +117,15 @@ tests:
- "add private ssh key to ssh server":
command: [docker, exec, sshHost, sh, -c, cat sshKey.pub > /root/.ssh/authorized_keys]
- "add remote with ssh key succeeds":
command: [titan, remote, add, -p, keyFile=$PWD/sshKey, ssh://root@$SSH_HOST:22/sshtest, sshTest]
command: [titan, remote, add, -p, keyFile=$PWD/sshKey, ssh://root@$SSH_HOST:2022/sshtest, sshTest]
env:
get:
- PWD
- SSH_HOST
- "repo has ssh remote with ssh key":
command: titan remote ls sshTest
stdout:
contains: ssh://root@$SSH_HOST:22/sshtest
contains: ssh://root@$SSH_HOST:2022/sshtest
env:
get:
- SSH_HOST
Expand All @@ -139,8 +139,8 @@ tests:
command: titan push sshTest
stdout:
contains:
- PUSH $KEY_COMMIT_GUID to origin RUNNING
- PUSH $KEY_COMMIT_GUID to origin COMPLETE
- Pushing $KEY_COMMIT_GUID to 'origin'
- Push completed successfully
env:
get:
- KEY_COMMIT_GUID
Expand Down Expand Up @@ -172,8 +172,8 @@ tests:
command: titan pull sshTest
stdout:
contains:
- PULL $KEY_COMMIT_GUID from origin RUNNING
- PULL $KEY_COMMIT_GUID from origin COMPLETE
- Pulling $KEY_COMMIT_GUID from 'origin'
- Pull completed successfully
env:
get:
- KEY_COMMIT_GUID
Expand Down