Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 21, 2025
1 parent 4459584 commit f4fe024
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
},
"GET /http-cache/hook-errors": {
"environments": ["compute"],
"feature": ["http-cache"]
"features": ["http-cache"]
},
"GET /http-cache/invalid-properties": {
"environments": ["compute"],
Expand Down
18 changes: 17 additions & 1 deletion integration-tests/js-compute/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,23 @@ async function setupKVStore() {
}
})();

const STORE_ID = existingStoreId(stores, KV_STORE_NAME);
let STORE_ID = existingStoreId(stores, KV_STORE_NAME);
if (STORE_ID) {
// it is possible for KV store to return a KV store that actually isn't available
// so test the KV store works before continuing
const res = await fetch(`https://api.fastly.com/resources/stores/kv/${STORE_ID}/keys?limit=1`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
'Fastly-Key': FASTLY_API_TOKEN,
},
});
console.log(res);
if (!res.ok) {
STORE_ID = null;
}
}
if (!STORE_ID) {
console.log(`Creating new KV store ${KV_STORE_NAME}`);
process.env.STORE_ID = JSON.parse(
Expand Down

0 comments on commit f4fe024

Please sign in to comment.