Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Combo update #85

Merged
merged 31 commits into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
492802c
Enable tests
ithinkihaveacat Sep 21, 2018
19bbb4e
Increase img ratio tolerance
ithinkihaveacat Sep 24, 2018
93d9988
Update tsc and fix type error
ithinkihaveacat Oct 1, 2018
f43c1ed
Switch to local include
ithinkihaveacat Oct 1, 2018
a0d1142
Add gitpod config
ithinkihaveacat Oct 1, 2018
9cf9596
Update .gitpod
ithinkihaveacat Oct 1, 2018
45df7bc
Handle thumbnail 404s
ithinkihaveacat Oct 1, 2018
0314334
Improve CLI output
ithinkihaveacat Oct 1, 2018
65feeae
Needs corsCache tests
ithinkihaveacat Oct 2, 2018
b25ff39
Implement testCorsCache
ithinkihaveacat Oct 2, 2018
584eeab
Actual caches.json
ithinkihaveacat Oct 2, 2018
cec4f8b
Simplify cartesian product (2D case)
ithinkihaveacat Oct 3, 2018
99891aa
Additional Tests
ithinkihaveacat Oct 4, 2018
408b146
Switch to amp-toolbox-cache-url
ithinkihaveacat Oct 4, 2018
9c79b63
Run simple end-to-end tests
ithinkihaveacat Oct 4, 2018
806f015
Fix URL
ithinkihaveacat Oct 4, 2018
68f1629
Add typings for amp-toolbox-cache-url
ithinkihaveacat Oct 4, 2018
d77b29f
Don't pass accept-encoding header
ithinkihaveacat Oct 5, 2018
28e3fdf
Merge branch 'test-cors' into dev
ithinkihaveacat Oct 5, 2018
88d2150
Merge branch 'handle-thumbnail-404' into dev
ithinkihaveacat Oct 5, 2018
c81d608
Merge branch 'increase-img-ratio-tolerance' into dev
ithinkihaveacat Oct 5, 2018
c8c5d97
Fix type error
ithinkihaveacat Oct 8, 2018
f88d4b5
Merge branch 'use-amp-toolbox-cache-url' into dev
ithinkihaveacat Oct 8, 2018
bcbb471
Merge branch 'run-amp-story-tests' into dev
ithinkihaveacat Oct 8, 2018
c5e875f
Merge branch 'update-linter-versions' into dev
ithinkihaveacat Oct 8, 2018
638e65a
Update string to match error
ithinkihaveacat Oct 8, 2018
864a010
Update test count
ithinkihaveacat Oct 8, 2018
6e7fbc7
Improve handling of copy as cURL
ithinkihaveacat Oct 8, 2018
6fd3e7c
Improve getImageSize error reporting
ithinkihaveacat Oct 8, 2018
102647b
Merge branch 'improve-support-for-curl' into combo-update
ithinkihaveacat Oct 8, 2018
5a4fce8
Handle stdin, again
ithinkihaveacat Oct 8, 2018
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
5 changes: 5 additions & 0 deletions .gitpod
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"
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ language: node_js
node_js:
- "6"
- "8"
- "node"
install: npm install
script: npm test
script: ./.travis_script.sh
39 changes: 39 additions & 0 deletions .travis_script.sh
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
4 changes: 4 additions & 0 deletions amp-story/linter/amp-toolbox-cache-url.d.ts
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;
}
18 changes: 18 additions & 0 deletions amp-story/linter/caches.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"caches": [
{
"id": "google",
"name": "Google AMP Cache",
"docs": "https://developers.google.com/amp/cache/",
"cacheDomain": "cdn.ampproject.org",
"updateCacheApiDomainSuffix": "cdn.ampproject.org"
},
{
"id": "cloudflare",
"name": "Cloudflare AMP Cache",
"docs": "https://amp.cloudflare.com/",
"cacheDomain": "cdn.cloudflare.com",
"updateCacheApiDomainSuffix": "amp.cloudflare.com"
}
]
}
Loading