forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds verified configuration and testing to issue digital-asset#14562
* Adds verified configuration and testing to issue digital-asset#14562 CHANGELOG_BEGIN * DAML Script Runner: DAR upload code in DAML script runner moved to integration tests. CHANGELOG_END
- Loading branch information
1 parent
e2d997a
commit f65e7f5
Showing
9 changed files
with
183 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"default_participant": {"host": "localhost", "port": 6865}, | ||
"participants": {}, | ||
"party_participants": {} | ||
} |
71 changes: 71 additions & 0 deletions
71
daml-script/runner/src/test/scala/com/daml/lf/engine/script/RunnerMainTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package com.daml.lf.engine.script | ||
|
||
import akka.actor.ActorSystem | ||
import com.daml.bazeltools.BazelRunfiles | ||
import com.daml.ledger.api.tls.TlsConfiguration | ||
import org.scalatest.Inspectors | ||
import org.scalatest.freespec.AnyFreeSpec | ||
import org.scalatest.matchers.should.Matchers | ||
|
||
import java.nio.file.{Path, Paths} | ||
|
||
class RunnerMainTest extends AnyFreeSpec with Matchers with Inspectors { | ||
|
||
import RunnerMainTest._ | ||
|
||
implicit val system: ActorSystem = ActorSystem() | ||
implicit val ec = system.dispatcher | ||
|
||
"RunnerMain should not crash" - { | ||
"with given configurations" in { | ||
forAll(Seq(configLedgerParticipant, configNodeParticipants)) { clientConfig => | ||
RunnerMain.RunnerConfig(clientConfig) shouldBe Symbol("success") | ||
} | ||
} | ||
} | ||
} | ||
|
||
object RunnerMainTest { | ||
val localHost: String = "localhost" | ||
val ledgerPort: Int = 8080 | ||
val participantPort: Int = 6865 | ||
val darFilePath: Path = | ||
BazelRunfiles.rlocation(Paths.get("daml-script/runner/src/test/resources/dummy.dar")) | ||
val participantConfigPath: Path = | ||
BazelRunfiles.rlocation( | ||
Paths.get("daml-script/runner/src/test/resources/participantConfig.json") | ||
) | ||
val configLedgerParticipant: RunnerCliConfig = RunnerCliConfig( | ||
darPath = darFilePath.toFile, | ||
scriptIdentifier = "Main:setup", | ||
ledgerHost = Some(localHost), | ||
ledgerPort = Some(ledgerPort), | ||
participantConfig = None, | ||
timeMode = ScriptConfig.DefaultTimeMode, | ||
inputFile = None, | ||
outputFile = None, | ||
accessTokenFile = None, | ||
tlsConfig = TlsConfiguration(enabled = false, None, None, None), | ||
jsonApi = false, | ||
maxInboundMessageSize = ScriptConfig.DefaultMaxInboundMessageSize, | ||
applicationId = None, | ||
) | ||
val configNodeParticipants: RunnerCliConfig = RunnerCliConfig( | ||
darPath = darFilePath.toFile, | ||
scriptIdentifier = "Main:setup", | ||
ledgerHost = None, | ||
ledgerPort = None, | ||
participantConfig = Some(participantConfigPath.toFile), | ||
timeMode = ScriptConfig.DefaultTimeMode, | ||
inputFile = None, | ||
outputFile = None, | ||
accessTokenFile = None, | ||
tlsConfig = TlsConfiguration(enabled = false, None, None, None), | ||
jsonApi = false, | ||
maxInboundMessageSize = ScriptConfig.DefaultMaxInboundMessageSize, | ||
applicationId = None, | ||
) | ||
} |
File renamed without changes.