This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ithinkihaveacat-combo-update'
- Loading branch information
Showing
20 changed files
with
1,546 additions
and
2,257 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,5 @@ | ||
tasks: | ||
- command: "npm install && npm test" | ||
ports: | ||
- port: 8080 | ||
protocol: "http" |
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 |
---|---|---|
|
@@ -2,5 +2,6 @@ language: node_js | |
node_js: | ||
- "6" | ||
- "8" | ||
- "node" | ||
install: npm install | ||
script: npm test | ||
script: ./.travis_script.sh |
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,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
npm test || exit | ||
|
||
trap 'kill $(jobs -p)' EXIT | ||
|
||
fetch() { | ||
echo "TESTING $1" | ||
res=$(curl -ksSo /dev/null -w "status:%{http_code} time:%{time_total} (%{size_download} bytes)" $1) | ||
if [[ $? -ne 0 ]]; then | ||
echo "ERROR $res" | ||
return | ||
fi | ||
if echo $res | grep -q "status:200" ; then | ||
echo "PASS $res" | ||
else | ||
echo "FAIL $res" | ||
fi | ||
} | ||
|
||
echo "STARTING AMPBENCH" | ||
|
||
npm start > npm_start.log 2>&1 & | ||
|
||
sleep 5 # wait for server to start | ||
|
||
echo | ||
echo "RUNNING TESTS" | ||
echo | ||
|
||
fetch 'http://localhost:8080/validate?url=http://www.bbc.com/news/amp/36884290' | ||
fetch 'http://localhost:8080/validate?url=https://www.bbc.com/news/amp/36884290' | ||
fetch 'http://localhost:8080/api2?url=https://www.bbc.com/news/amp/36884290' | ||
|
||
kill $(jobs -p) | ||
|
||
echo | ||
echo "NPM LOG" | ||
cat npm_start.log |
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,4 @@ | ||
declare module "amp-toolbox-cache-url" { | ||
function createCacheUrl(cacheSuffix: string, url: string): Promise<string>; | ||
export = createCacheUrl; | ||
} |
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,20 @@ | ||
{ | ||
"caches": [ | ||
{ | ||
"id": "google", | ||
"name": "Google AMP Cache", | ||
"docs": "https://developers.google.com/amp/cache/", | ||
"cacheDomain": "cdn.ampproject.org", | ||
"updateCacheApiDomainSuffix": "cdn.ampproject.org", | ||
"thirdPartyFrameDomainSuffix": "ampproject.net" | ||
}, | ||
{ | ||
"id": "cloudflare", | ||
"name": "Cloudflare AMP Cache", | ||
"docs": "https://amp.cloudflare.com/", | ||
"cacheDomain": "cdn.cloudflare.com", | ||
"updateCacheApiDomainSuffix": "amp.cloudflare.com", | ||
"thirdPartyFrameDomainSuffix": "cloudflareamp.net" | ||
} | ||
] | ||
} |
Oops, something went wrong.