-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: DA Automation <[email protected]> Co-authored-by: DA Automation <[email protected]>
- Loading branch information
1 parent
21584a2
commit 925d604
Showing
77 changed files
with
1,270 additions
and
816 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.2.1 | ||
0.2.3 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
0.2.2 | ||
0.2.4 |
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
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
32 changes: 32 additions & 0 deletions
32
...src/test/scala/com/daml/network/integration/tests/ValidatorLicensesFrontendTestUtil.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,32 @@ | ||
package com.daml.network.integration.tests | ||
|
||
import com.digitalasset.canton.topology.PartyId | ||
import org.scalatest.Assertion | ||
|
||
trait ValidatorLicensesFrontendTestUtil { self: FrontendIntegrationTestWithSharedEnvironment => | ||
|
||
def getLicensesTableRows(implicit webDriver: WebDriverType) = { | ||
findAll(className("validator-licenses-table-row")).toList | ||
} | ||
|
||
def checkLastValidatorLicenseRow( | ||
previousSize: Long, | ||
expectedSponsor: PartyId, | ||
expectedValidator: PartyId, | ||
)(implicit webDriver: WebDriverType): Assertion = { | ||
val newLicenseRows = findAll(className("validator-licenses-table-row")).toList | ||
newLicenseRows should have size (previousSize + 1L) | ||
val row: Element = inside(newLicenseRows) { case row :: _ => | ||
row | ||
} | ||
val sponsor = | ||
seleniumText(row.childElement(className("validator-licenses-sponsor"))) | ||
|
||
val validator = | ||
seleniumText(row.childElement(className("validator-licenses-validator"))) | ||
|
||
sponsor shouldBe expectedSponsor.toProtoPrimitive | ||
validator shouldBe expectedValidator.toProtoPrimitive | ||
} | ||
|
||
} |
52 changes: 0 additions & 52 deletions
52
apps/app/src/test/scala/com/daml/network/integration/tests/WalletAmuletMetricsTest.scala
This file was deleted.
Oops, something went wrong.
111 changes: 111 additions & 0 deletions
111
apps/app/src/test/scala/com/daml/network/integration/tests/WalletMetricsTest.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,111 @@ | ||
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package com.daml.network.integration.tests | ||
|
||
import com.daml.network.integration.EnvironmentDefinition | ||
import com.daml.network.integration.tests.SpliceTests.IntegrationTestWithSharedEnvironment | ||
import com.daml.network.util.{WalletTestUtil} | ||
import com.digitalasset.canton.HasExecutionContext | ||
import com.digitalasset.canton.metrics.MetricValue | ||
|
||
class WalletMetricsTest | ||
extends IntegrationTestWithSharedEnvironment | ||
with HasExecutionContext | ||
with WalletTestUtil | ||
with WalletTxLogTestUtil { | ||
|
||
override def environmentDefinition: EnvironmentDefinition = { | ||
EnvironmentDefinition | ||
.simpleTopology1Sv(this.getClass.getSimpleName) | ||
} | ||
|
||
"Unlocked coin metrics" should { | ||
"update when tapping coin" in { implicit env => | ||
val aliceUserParty = onboardWalletUser(aliceWalletClient, aliceValidatorBackend) | ||
val before = aliceValidatorBackend.metrics | ||
.get( | ||
"cn.wallet.unlocked-amulet-balance", | ||
Map("owner" -> aliceUserParty.toString), | ||
) | ||
.select[MetricValue.DoublePoint] | ||
.value | ||
.value | ||
before shouldBe 0 | ||
actAndCheck( | ||
"alice taps 100 coin", | ||
aliceWalletClient.tap(100.0), | ||
)( | ||
"metrics update to reflect new coins", | ||
_ => { | ||
val after = aliceValidatorBackend.metrics | ||
.get("cn.wallet.unlocked-amulet-balance", Map("owner" -> aliceUserParty.toString)) | ||
.select[MetricValue.DoublePoint] | ||
.value | ||
.value | ||
val tapCC = walletUsdToAmulet(100.0) | ||
BigDecimal(after) should beWithin(tapCC - smallAmount, tapCC) | ||
}, | ||
) | ||
} | ||
} | ||
|
||
"User wallet automation metrics" should { | ||
"are labeled with the party ID of the wallet user" in { implicit env => | ||
val aliceUserParty = onboardWalletUser(aliceWalletClient, aliceValidatorBackend) | ||
val bobUserParty = onboardWalletUser(bobWalletClient, bobValidatorBackend) | ||
aliceWalletClient.tap(100.0) | ||
p2pTransfer(aliceWalletClient, bobWalletClient, bobUserParty, 50.0) | ||
|
||
// Polling triggers | ||
// Not exhaustive, only triggers configured to run (e.g., no WalletSweepTrigger) | ||
Seq( | ||
"AmuletMetricsTrigger", | ||
"CollectRewardsAndMergeAmuletsTrigger", | ||
"DomainIngestionService", | ||
"ExpireAcceptedTransferOfferTrigger", | ||
"ExpireAppPaymentRequestsTrigger", | ||
"ExpireBuyTrafficRequestsTrigger", | ||
"ExpireTransferOfferTrigger", | ||
"SubscriptionReadyForPaymentTrigger", | ||
"TransferFollowTrigger", | ||
).foreach(triggerName => | ||
clue(s"$triggerName should report polling iterations correctly") { | ||
aliceValidatorBackend.metrics | ||
.get( | ||
"cn.trigger.iterations", | ||
Map( | ||
"trigger_name" -> triggerName, | ||
"party" -> aliceUserParty.toString, | ||
), | ||
) | ||
.select[MetricValue.LongPoint] | ||
.value | ||
// We always do one iteration right after startup | ||
.value should be > 0L | ||
} | ||
) | ||
|
||
// Task-based triggers | ||
// Not exhaustive, only triggers that are invoked during init and transfers | ||
Seq( | ||
"AcceptedTransferOfferTrigger", | ||
"DomainIngestionService", | ||
).foreach(triggerName => | ||
clue(s"$triggerName should report task completions correctly") { | ||
aliceValidatorBackend.metrics | ||
.get( | ||
"cn.trigger.completed", | ||
Map( | ||
"trigger_name" -> triggerName, | ||
"party" -> aliceUserParty.toString, | ||
), | ||
) | ||
.select[MetricValue.LongPoint] | ||
.value | ||
.value should be > 0L | ||
} | ||
) | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './vitest.common.conf'; | ||
export { validatorLicensesHandler } from './mocks/handlers/validator-licenses-handler'; | ||
export { dsoInfoHandler, dsoInfo } from './mocks/handlers/dso-info-handler'; |
Oops, something went wrong.