Skip to content

Commit 1ed9c53

Browse files
author
sergey-ermakovich
committed
Compute the canary date at run time so the scheduled CI cannot expire
1 parent 5cc5452 commit 1ed9c53

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/tools.test.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,13 @@ test('every tool carries a description', live, async () => {
126126
});
127127

128128
test('the key is accepted by HasData', live, async () => {
129+
// Compute the dates at run time. A hardcoded future date silently becomes a past date and
130+
// then Booking.com rejects the check-in, turning this canary red for the wrong reason.
131+
const checkInDate = new Date(Date.now() + 30 * 86_400_000).toISOString().slice(0, 10);
132+
const checkOutDate = new Date(Date.now() + 33 * 86_400_000).toISOString().slice(0, 10);
129133
const { raw } = await rpc('tools/call', {
130134
name: 'hasdata_booking_search_getBookingSearchResults',
131-
arguments: { keyword: 'Paris', checkInDate: '2026-09-15', checkOutDate: '2026-09-18', rooms: 1, adults: 2, children: 0 },
135+
arguments: { keyword: 'Paris', checkInDate, checkOutDate, rooms: 1, adults: 2, children: 0 },
132136
});
133137
assert.ok(!raw.includes('401 Unauthorized'), 'HasData rejected the key');
134138
assert.ok(!raw.includes('"isError":true'), `the tool call failed: ${raw.slice(0, 300)}`);

0 commit comments

Comments
 (0)