Skip to content

Commit

Permalink
disable tests with @disabled
Browse files Browse the repository at this point in the history
Signed-off-by: ibankov <ivan.bankov@limechain.tech>
  • Loading branch information
ibankov committed Oct 30, 2024
1 parent a295a8b commit 8c778c8
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,24 @@
import static com.hedera.services.bdd.spec.utilops.UtilVerbs.overriding;
import static com.hedera.services.bdd.suites.HapiSuite.ONE_HBAR;

import com.hedera.services.bdd.junit.HapiTest;
import com.hedera.services.bdd.junit.HapiTestLifecycle;
import com.hedera.services.bdd.junit.support.TestLifecycle;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.TestMethodOrder;

// Enable when long term scheduling is enabled
// @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
// @HapiTestLifecycle
@Disabled
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@HapiTestLifecycle
public class DisabledLongTermExecutionScheduleTest {

private static final String RECEIVER = "receiver";
Expand All @@ -47,7 +55,7 @@ public class DisabledLongTermExecutionScheduleTest {
private static final String THREE_SIG_XFER = "threeSigXfer";
private static final String SCHEDULING_LONG_TERM_ENABLED = "scheduling.longTermEnabled";

// @BeforeAll
@BeforeAll
static void beforeAll(@NonNull final TestLifecycle lifecycle) {
// override and preserve old values
lifecycle.overrideInClass(Map.of(
Expand All @@ -57,8 +65,8 @@ static void beforeAll(@NonNull final TestLifecycle lifecycle) {
"CryptoTransfer,ConsensusSubmitMessage,TokenBurn,TokenMint,CryptoApproveAllowance"));
}

// @HapiTest
// @Order(1)
@HapiTest
@Order(1)
public Stream<DynamicTest> waitForExpiryIgnoredWhenLongTermDisabled() {

return defaultHapiSpec("WaitForExpiryIgnoredWhenLongTermDisabled")
Expand All @@ -85,8 +93,8 @@ public Stream<DynamicTest> waitForExpiryIgnoredWhenLongTermDisabled() {
.isExecuted());
}

// @HapiTest
// @Order(2)
@HapiTest
@Order(2)
public Stream<DynamicTest> expiryIgnoredWhenLongTermDisabled() {
return defaultHapiSpec("ExpiryIgnoredWhenLongTermDisabled")
.given(
Expand All @@ -108,8 +116,8 @@ public Stream<DynamicTest> expiryIgnoredWhenLongTermDisabled() {
getAccountBalance(RECEIVER).hasTinyBars(1L));
}

// @HapiTest
// @Order(3)
@HapiTest
@Order(3)
public Stream<DynamicTest> waitForExpiryIgnoredWhenLongTermDisabledThenEnabled() {

return defaultHapiSpec("WaitForExpiryIgnoredWhenLongTermDisabledThenEnabled")
Expand Down Expand Up @@ -139,8 +147,8 @@ public Stream<DynamicTest> waitForExpiryIgnoredWhenLongTermDisabledThenEnabled()
overriding(SCHEDULING_LONG_TERM_ENABLED, "false"));
}

// @HapiTest
// @Order(4)
@HapiTest
@Order(4)
public Stream<DynamicTest> expiryIgnoredWhenLongTermDisabledThenEnabled() {
return defaultHapiSpec("ExpiryIgnoredWhenLongTermDisabledThenEnabled")
.given(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
import static com.hederahashgraph.api.proto.java.ResponseCodeEnum.RECORD_NOT_FOUND;
import static com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS;

import com.hedera.services.bdd.junit.HapiTest;
import com.hedera.services.bdd.junit.HapiTestLifecycle;
import com.hedera.services.bdd.junit.support.TestLifecycle;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.math.BigInteger;
Expand All @@ -90,11 +92,17 @@
import java.util.Optional;
import java.util.stream.Stream;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.TestMethodOrder;

// Enable when long term scheduling is enabled
// @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
// @HapiTestLifecycle
@Disabled
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@HapiTestLifecycle
public class ScheduleLongTermExecutionTest {
private static final String PAYING_ACCOUNT = "payingAccount";
private static final String RECEIVER = "receiver";
Expand All @@ -110,7 +118,7 @@ public class ScheduleLongTermExecutionTest {
private static final String WEIRDLY_POPULAR_KEY_TXN = "weirdlyPopularKeyTxn";
private static final String PAYER_TXN = "payerTxn";

// @BeforeAll
@BeforeAll
static void beforeAll(@NonNull final TestLifecycle lifecycle) {
// override and preserve old values
lifecycle.overrideInClass(Map.of(
Expand All @@ -123,8 +131,8 @@ static void beforeAll(@NonNull final TestLifecycle lifecycle) {
}

@SuppressWarnings("java:S5960")
// @HapiTest
// @Order(1)
@HapiTest
@Order(1)
final Stream<DynamicTest> executionWithCustomPayerWorks() {
return defaultHapiSpec("ExecutionAtExpiryWithCustomPayerWorks")
.given(
Expand Down Expand Up @@ -230,8 +238,8 @@ final Stream<DynamicTest> executionWithCustomPayerWorks() {
}));
}

// @HapiTest
// @Order(2)
@HapiTest
@Order(2)
final Stream<DynamicTest> executionWithCustomPayerAndAdminKeyWorks() {
return defaultHapiSpec("ExecutionAtExpiryWithCustomPayerAndAdminKeyWorks")
.given(
Expand Down Expand Up @@ -339,8 +347,8 @@ final Stream<DynamicTest> executionWithCustomPayerAndAdminKeyWorks() {
}));
}

// @HapiTest
// @Order(3)
@HapiTest
@Order(3)
final Stream<DynamicTest> executionWithCustomPayerWhoSignsAtCreationAsPayerWorks() {
return defaultHapiSpec("ExecutionAtExpiryWithCustomPayerWhoSignsAtCreationAsPayerWorks")
.given(
Expand Down Expand Up @@ -447,8 +455,8 @@ final Stream<DynamicTest> executionWithCustomPayerWhoSignsAtCreationAsPayerWorks
}));
}

// @HapiTest
// @Order(4)
@HapiTest
@Order(4)
public Stream<DynamicTest> executionWithDefaultPayerWorks() {
long transferAmount = 1;
return defaultHapiSpec("ExecutionAtExpiryWithDefaultPayerWorks")
Expand Down Expand Up @@ -551,8 +559,8 @@ public Stream<DynamicTest> executionWithDefaultPayerWorks() {
}));
}

// @HapiTest
// @Order(5)
@HapiTest
@Order(5)
public Stream<DynamicTest> executionWithContractCallWorksAtExpiry() {
return defaultHapiSpec("ExecutionWithContractCallWorksAtExpiry")
.given(
Expand Down Expand Up @@ -602,8 +610,8 @@ public Stream<DynamicTest> executionWithContractCallWorksAtExpiry() {
}));
}

// @HapiTest
// @Order(6)
@HapiTest
@Order(6)
public Stream<DynamicTest> executionWithContractCreateWorksAtExpiry() {
return defaultHapiSpec("ExecutionWithContractCreateWorksAtExpiry")
.given(
Expand Down Expand Up @@ -659,8 +667,8 @@ public Stream<DynamicTest> executionWithContractCreateWorksAtExpiry() {
}));
}

// @HapiTest
// @Order(7)
@HapiTest
@Order(7)
public Stream<DynamicTest> executionWithDefaultPayerButNoFundsFails() {
long balance = 10_000_000L;
long noBalance = 0L;
Expand Down Expand Up @@ -710,8 +718,8 @@ public Stream<DynamicTest> executionWithDefaultPayerButNoFundsFails() {
}));
}

// @HapiTest
// @Order(8)
@HapiTest
@Order(8)
public Stream<DynamicTest> executionWithCustomPayerThatNeverSignsFails() {
long transferAmount = 1;
return defaultHapiSpec("ExecutionWithCustomPayerThatNeverSignsFails")
Expand Down Expand Up @@ -743,8 +751,8 @@ public Stream<DynamicTest> executionWithCustomPayerThatNeverSignsFails() {
getTxnRecord(CREATE_TX).scheduled().hasAnswerOnlyPrecheck(RECORD_NOT_FOUND));
}

// @HapiTest
// @Order(9)
@HapiTest
@Order(9)
public Stream<DynamicTest> executionWithCustomPayerButNoFundsFails() {
long balance = 0L;
long transferAmount = 1;
Expand Down Expand Up @@ -786,8 +794,8 @@ public Stream<DynamicTest> executionWithCustomPayerButNoFundsFails() {
}));
}

// @HapiTest
// @Order(10)
@HapiTest
@Order(10)
public Stream<DynamicTest> executionWithDefaultPayerButAccountDeletedFails() {
long balance = 10_000_000L;
long noBalance = 0L;
Expand Down Expand Up @@ -828,8 +836,8 @@ public Stream<DynamicTest> executionWithDefaultPayerButAccountDeletedFails() {
.hasPriority(recordWith().statusFrom(PAYER_ACCOUNT_DELETED)));
}

// @HapiTest
// @Order(11)
@HapiTest
@Order(11)
public Stream<DynamicTest> executionWithCustomPayerButAccountDeletedFails() {
long balance = 10_000_000L;
long noBalance = 0L;
Expand Down Expand Up @@ -873,8 +881,8 @@ public Stream<DynamicTest> executionWithCustomPayerButAccountDeletedFails() {
recordWith().statusFrom(INSUFFICIENT_ACCOUNT_BALANCE, PAYER_ACCOUNT_DELETED)));
}

// @HapiTest
// @Order(12)
@HapiTest
@Order(12)
public Stream<DynamicTest> executionWithInvalidAccountAmountsFails() {
long transferAmount = 100;
long senderBalance = 1000L;
Expand All @@ -898,8 +906,8 @@ public Stream<DynamicTest> executionWithInvalidAccountAmountsFails() {
.then();
}

// @HapiTest
// @Order(13)
@HapiTest
@Order(13)
public Stream<DynamicTest> executionWithCryptoInsufficientAccountBalanceFails() {
long noBalance = 0L;
long senderBalance = 100L;
Expand Down Expand Up @@ -945,8 +953,8 @@ public Stream<DynamicTest> executionWithCryptoInsufficientAccountBalanceFails()
}));
}

// @HapiTest
// @Order(14)
@HapiTest
@Order(14)
public Stream<DynamicTest> executionWithCryptoSenderDeletedFails() {
long noBalance = 0L;
long senderBalance = 100L;
Expand Down Expand Up @@ -994,8 +1002,8 @@ public Stream<DynamicTest> executionWithCryptoSenderDeletedFails() {
}));
}

// @HapiTest
// @Order(15)
@HapiTest
@Order(15)
public Stream<DynamicTest> executionTriggersWithWeirdlyRepeatedKey() {
String schedule = "dupKeyXfer";

Expand Down Expand Up @@ -1038,8 +1046,8 @@ public Stream<DynamicTest> executionTriggersWithWeirdlyRepeatedKey() {
.hasKnownStatus(INVALID_SCHEDULE_ID));
}

// @HapiTest
// @Order(16)
@HapiTest
@Order(16)
final Stream<DynamicTest> scheduledFreezeWorksAsExpected() {

return defaultHapiSpec("ScheduledFreezeWorksAsExpectedAtExpiry")
Expand Down Expand Up @@ -1072,8 +1080,8 @@ final Stream<DynamicTest> scheduledFreezeWorksAsExpected() {
}));
}

// @HapiTest
// @Order(17)
@HapiTest
@Order(17)
final Stream<DynamicTest> scheduledFreezeWithUnauthorizedPayerFails() {

return defaultHapiSpec("ScheduledFreezeWithUnauthorizedPayerFailsAtExpiry")
Expand All @@ -1090,8 +1098,8 @@ final Stream<DynamicTest> scheduledFreezeWithUnauthorizedPayerFails() {
);
}

// @HapiTest
// @Order(18)
@HapiTest
@Order(18)
final Stream<DynamicTest> scheduledPermissionedFileUpdateWorksAsExpected() {

return defaultHapiSpec("ScheduledPermissionedFileUpdateWorksAsExpectedAtExpiry")
Expand Down Expand Up @@ -1133,8 +1141,8 @@ final Stream<DynamicTest> scheduledPermissionedFileUpdateWorksAsExpected() {
}));
}

// @HapiTest
// @Order(19)
@HapiTest
@Order(19)
final Stream<DynamicTest> scheduledPermissionedFileUpdateUnauthorizedPayerFails() {

return defaultHapiSpec("ScheduledPermissionedFileUpdateUnauthorizedPayerFailsAtExpiry")
Expand Down Expand Up @@ -1177,8 +1185,8 @@ final Stream<DynamicTest> scheduledPermissionedFileUpdateUnauthorizedPayerFails(
}));
}

// @HapiTest
// @Order(20)
@HapiTest
@Order(20)
final Stream<DynamicTest> scheduledSystemDeleteWorksAsExpected() {

return defaultHapiSpec("ScheduledSystemDeleteWorksAsExpectedAtExpiry")
Expand Down Expand Up @@ -1220,8 +1228,8 @@ final Stream<DynamicTest> scheduledSystemDeleteWorksAsExpected() {
}));
}

// @HapiTest
// @Order(21)
@HapiTest
@Order(21)
final Stream<DynamicTest> scheduledSystemDeleteUnauthorizedPayerFails() {

return defaultHapiSpec("ScheduledSystemDeleteUnauthorizedPayerFailsAtExpiry")
Expand Down
Loading

0 comments on commit 8c778c8

Please sign in to comment.