mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
Fix json API options in compat tests (#6084)
--allow-insecure-tokens only exists in recent SDKs. changelog_begin changelog_end
This commit is contained in:
parent
2b1468e0e7
commit
5b19aafc18
@ -21,6 +21,7 @@ import waitOn from "wait-on";
|
||||
import Ledger from "@daml/ledger";
|
||||
import { User } from "@daml.js/create-daml-app";
|
||||
import { computeCredentials } from "./Credentials";
|
||||
import semver from "semver";
|
||||
|
||||
const DAR_PATH = ".daml/dist/create-daml-app-0.1.0.dar";
|
||||
const SANDBOX_LEDGER_ID = "create-daml-app-sandbox";
|
||||
@ -131,18 +132,27 @@ beforeAll(async () => {
|
||||
|
||||
const jsonApiOptions = [
|
||||
"json-api",
|
||||
"--allow-insecure-tokens",
|
||||
"--ledger-host=localhost",
|
||||
`--ledger-port=${sandboxPort}`,
|
||||
`--http-port=${JSON_API_PORT}`,
|
||||
`--port-file=${JSON_API_PORT_FILE_NAME}`,
|
||||
];
|
||||
jsonApi = spawn(process.env.DAML_JSON_API, jsonApiOptions, {
|
||||
cwd: "..",
|
||||
stdio: "inherit",
|
||||
detached: detached,
|
||||
env: { ...process.env, DAML_SDK_VERSION: process.env.JSON_API_VERSION },
|
||||
});
|
||||
const extraJsonApiOptions = semver.gte(
|
||||
process.env.JSON_API_VERSION,
|
||||
"1.1.0-snapshot.20200430.4057.0.681c862d"
|
||||
)
|
||||
? ["--allow-insecure-tokens"]
|
||||
: [];
|
||||
jsonApi = spawn(
|
||||
process.env.DAML_JSON_API,
|
||||
jsonApiOptions.concat(extraJsonApiOptions),
|
||||
{
|
||||
cwd: "..",
|
||||
stdio: "inherit",
|
||||
detached: detached,
|
||||
env: { ...process.env, DAML_SDK_VERSION: process.env.JSON_API_VERSION },
|
||||
}
|
||||
);
|
||||
await waitOn({ resources: [`file:../${JSON_API_PORT_FILE_NAME}`] });
|
||||
|
||||
uiProc = spawn("yarn", ["start"], {
|
||||
|
Loading…
Reference in New Issue
Block a user