Skip to content

Commit 3a06125

Browse files
Added scripts for tests
1 parent a68845e commit 3a06125

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+740
-7
lines changed

.circleci/config.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: springcloud/pipeline-base
6+
environment:
7+
JAVA_TOOL_OPTIONS: "-Xms512m -Xmx768m"
8+
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx512m -Xmx768m -XX:+HeapDumpOnOutOfMemoryError" -Dorg.gradle.daemon=false'
9+
TERM: dumb
10+
branches:
11+
ignore:
12+
- gh-pages # list of branches to ignore
13+
resource_class: large
14+
steps:
15+
- setup_remote_docker
16+
- checkout
17+
- run:
18+
name: "Adding daemon entries for Gradle"
19+
command: touch ~/.gradle/gradle.properties && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
20+
- run:
21+
name: "Running build"
22+
command: ./scripts/runAcceptanceTests.sh
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: "2"
2+
services:
3+
mongo:
4+
image: mongo:jessie
5+
ports: ["27017:27017"]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
description: |
2+
Should add a book
3+
request:
4+
method: POST
5+
url: /api/books
6+
headers:
7+
Content-Type: application/json
8+
body: '{
9+
"title" : "Title",
10+
"genre" : "Genre",
11+
"description" : "Description",
12+
"author" : "Author",
13+
"publisher" : "Publisher",
14+
"pages" : 100,
15+
"image_url" : "https://d213dhlpdb53mu.cloudfront.net/assets/pivotal-square-logo-41418bd391196c3022f3cd9f3959b3f6d7764c47873d858583384e759c7db435.svg",
16+
"buy_url" : "https://pivotal.io"
17+
}'
18+
response:
19+
status: 200
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
description: |
2+
Should return info about other endpoints to query
3+
request:
4+
method: GET
5+
url: /api/books
6+
response:
7+
status: 200
8+
headers:
9+
Content-Type: application/json
10+
body: '{
11+
"title" : "Title",
12+
"genre" : "Genre",
13+
"description" : "Description",
14+
"author" : "Author",
15+
"publisher" : "Publisher",
16+
"pages" : 100,
17+
"image_url" : "https://d213dhlpdb53mu.cloudfront.net/assets/pivotal-square-logo-41418bd391196c3022f3cd9f3959b3f6d7764c47873d858583384e759c7db435.svg",
18+
"buy_url" : "https://pivotal.io"
19+
}'
20+
matchers:
21+
headers:
22+
- key: Content-Type
23+
regex: application/json.*

git_repository/git/COMMIT_EDITMSG

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Initial commit
2+
3+
# Please enter the commit message for your changes. Lines starting
4+
# with '#' will be ignored, and an empty message aborts the commit.
5+
#
6+
# Date: Thu Mar 29 14:20:09 2018 +0200
7+
#
8+
# On branch master
9+
#
10+
# Initial commit
11+
#
12+
# Changes to be committed:
13+
# new file: META-INF/com.example/bookstore/0.0.1.RELEASE/contracts/1_shouldAddABook.yml
14+
# new file: META-INF/com.example/bookstore/0.0.1.RELEASE/contracts/2_shouldReturnListOfBooks.yml
15+
#

git_repository/git/HEAD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ref: refs/heads/master

git_repository/git/config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[core]
2+
repositoryformatversion = 0
3+
filemode = true
4+
bare = false
5+
logallrefupdates = true
6+
ignorecase = true
7+
precomposeunicode = true

git_repository/git/description

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Unnamed repository; edit this file 'description' to name the repository.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
#
3+
# An example hook script to check the commit log message taken by
4+
# applypatch from an e-mail message.
5+
#
6+
# The hook should exit with non-zero status after issuing an
7+
# appropriate message if it wants to stop the commit. The hook is
8+
# allowed to edit the commit message file.
9+
#
10+
# To enable this hook, rename this file to "applypatch-msg".
11+
12+
. git-sh-setup
13+
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
14+
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
15+
:
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
#
3+
# An example hook script to check the commit log message.
4+
# Called by "git commit" with one argument, the name of the file
5+
# that has the commit message. The hook should exit with non-zero
6+
# status after issuing an appropriate message if it wants to stop the
7+
# commit. The hook is allowed to edit the commit message file.
8+
#
9+
# To enable this hook, rename this file to "commit-msg".
10+
11+
# Uncomment the below to add a Signed-off-by line to the message.
12+
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
13+
# hook is more suited to it.
14+
#
15+
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
16+
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
17+
18+
# This example catches duplicate Signed-off-by lines.
19+
20+
test "" = "$(grep '^Signed-off-by: ' "$1" |
21+
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
22+
echo >&2 Duplicate Signed-off-by lines.
23+
exit 1
24+
}

0 commit comments

Comments
 (0)