Skip to content

Commit 93e64e5

Browse files
author
sergey-ermakovich
committed
Compute the canary date at run time so the scheduled CI cannot expire
1 parent fb9124e commit 93e64e5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/tools.test.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,12 @@ test('the tool carries a description', live, async () => {
125125
});
126126

127127
test('the key is accepted by HasData', live, async () => {
128+
// Compute the date at run time. A hardcoded future date silently becomes a past date and
129+
// then Google rejects the outbound date, turning this canary red for the wrong reason.
130+
const outboundDate = new Date(Date.now() + 30 * 86_400_000).toISOString().slice(0, 10);
128131
const { raw } = await rpc('tools/call', {
129132
name: 'hasdata_google_travel_flights_getGoogleFlights',
130-
arguments: { departureId: 'JFK', arrivalId: 'LHR', outboundDate: '2026-09-15', type: 'oneWay' },
133+
arguments: { departureId: 'JFK', arrivalId: 'LHR', outboundDate, type: 'oneWay' },
131134
});
132135
assert.ok(!raw.includes('401 Unauthorized'), 'HasData rejected the key');
133136
assert.ok(!raw.includes('"isError":true'), `the tool call failed: ${raw.slice(0, 300)}`);

0 commit comments

Comments
 (0)