|
| 1 | +// Copyright (c) 2023 - Restate Software, Inc., Restate GmbH |
| 2 | +// |
| 3 | +// This file is part of the Restate e2e tests, |
| 4 | +// which are released under the MIT license. |
| 5 | +// |
| 6 | +// You can find a copy of the license in file LICENSE in the root |
| 7 | +// directory of this repository or package, or at |
| 8 | +// https://github.com/restatedev/e2e/blob/main/LICENSE |
| 9 | + |
| 10 | +import * as restate from "@restatedev/restate-sdk"; |
| 11 | + |
| 12 | +import "./awakeable_holder.js"; |
| 13 | +import "./counter.js"; |
| 14 | +import "./event_handler.js"; |
| 15 | +import "./list.js"; |
| 16 | +import "./map.js"; |
| 17 | +import "./cancel_test.js"; |
| 18 | +import "./non_determinism.js"; |
| 19 | +import "./failing.js"; |
| 20 | +import "./side_effect.js"; |
| 21 | +import "./workflow.js"; |
| 22 | +import "./proxy.js"; |
| 23 | +import "./test_utils.js"; |
| 24 | + |
| 25 | +import { REGISTRY } from "./services.js"; |
| 26 | + |
| 27 | +if (!process.env.SERVICES) { |
| 28 | + throw new Error("Cannot find SERVICES env"); |
| 29 | +} |
| 30 | +const fqdns = new Set(process.env.SERVICES.split(",")); |
| 31 | +const endpoint = restate.endpoint(); |
| 32 | +REGISTRY.register(fqdns, endpoint); |
| 33 | + |
| 34 | +if (process.env.E2E_REQUEST_SIGNING) { |
| 35 | + endpoint.withIdentityV1(...process.env.E2E_REQUEST_SIGNING.split(",")); |
| 36 | +} |
| 37 | +if (!process.env.AWS_LAMBDA_FUNCTION_NAME) { |
| 38 | + endpoint.listen().catch((e) => { |
| 39 | + // eslint-disable-next-line no-console |
| 40 | + console.error(e); |
| 41 | + }); |
| 42 | +} |
| 43 | + |
| 44 | +export const handler = endpoint.lambdaHandler(); |
0 commit comments