Skip to content

Commit

Permalink
chore: Refactor Test Clients to use "resources" directory (#14536)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Moran <152873392+thomas-swirlds-labs@users.noreply.github.com>
  • Loading branch information
thomas-swirlds-labs authored Aug 20, 2024
1 parent 0b193f8 commit 1fe6a2d
Show file tree
Hide file tree
Showing 864 changed files with 20 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -1070,3 +1070,6 @@ gha-creds-*.json

### Temporary ignore for differential testing
hedera-node/test-clients/rcdiff/diff.txt

### Ignore binary files in Test-Clients root
hedera-node/test-clients/*.bin
4 changes: 2 additions & 2 deletions docs/intellij-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Run `HelloWorldSpec` with the following Gradle command:
./gradlew runTestClient -PtestClient=com.hedera.services.bdd.suites.crypto.HelloWorldSpec
```

Because [`node=localhost`](../test-clients/src/main/resource/spec-default.properties) in the
Because [`node=localhost`](../test-clients/src/main/resources/spec-default.properties) in the
_spec-default.properties_ controlling the `HelloWorldSpec` test, this will run against your local
network, culminating in logs similar to:

Expand All @@ -129,7 +129,7 @@ network, culminating in logs similar to:

(This client uses account `0.0.2` as the default payer, and is aware of the above keypair via its
configuration in
[_spec-default.properties_](../test-clients/src/main/resource/spec-default.properties) under the
[_spec-default.properties_](../test-clients/src/main/resources/spec-default.properties) under the
`startupAccounts.path` key).

### Stopping/restarting the network
Expand Down
4 changes: 0 additions & 4 deletions hedera-node/test-clients/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ mainModuleInfo {
}

sourceSets {
// Needed because "resource" directory is misnamed. See
// https://github.com/hashgraph/hedera-services/issues/3361
main { resources { srcDir("src/main/resource") } }

create("rcdiff")
create("yahcli")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ final Stream<DynamicTest> chunkTransactionIDIsValidated() {

@HapiTest
final Stream<DynamicTest> longMessageIsFragmentedIntoChunks() {
String fileForLongMessage = "src/main/resource/RandomLargeBinary.bin";
String fileForLongMessage = "src/main/resources/RandomLargeBinary.bin";
return defaultHapiSpec("longMessageIsFragmentedIntoChunks")
.given(cryptoCreate("payer"), createTopic("testTopic"))
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
import org.json.JSONTokener;

public class Utils {
public static final String RESOURCE_PATH = "src/main/resource/contract/contracts/%1$s/%1$s%2$s";
public static final String RESOURCE_PATH = "src/main/resources/contract/contracts/%1$s/%1$s%2$s";

public static final String UNIQUE_CLASSPATH_RESOURCE_TPL = "contract/contracts/%s/%s";
private static final Logger log = LogManager.getLogger(Utils.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public enum CallResultsSnapshot {

private static final String CALL_RESULT_KEY = "callResults";
private static final String STATIC_CALL_RESULT_KEY = "staticCallResults";
private static final String SNAPSHOT_LOC = "hedera-node/test-clients/src/main/resource/call-results-snapshot.json";
private static final String SNAPSHOT_LOC = "hedera-node/test-clients/src/main/resources/call-results-snapshot.json";
private static final Map<String, Map<ClassicFailureMode, FailableCallResult>> CALL_RESULTS =
new ConcurrentHashMap<>();
private static final Map<String, Map<ClassicFailureMode, FailableStaticCallResult>> STATIC_CALL_RESULTS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ public final class DiverseStateCreation extends HapiSuite {
public static final String KEY_REPRS_KEY = "keyReprs";
public static final String HEXED_BYTECODE_KEY = "hexedBytecode";

public static final String SMALL_CONTENTS_LOC = "src/main/resource/testfiles/small.txt";
public static final String MEDIUM_CONTENTS_LOC = "src/main/resource/testfiles/medium.txt";
public static final String LARGE_CONTENTS_LOC = "src/main/resource/testfiles/large.txt";
public static final String STATE_META_JSON_LOC = "src/main/resource/testfiles/diverseBlobsInfo.json";
public static final String SMALL_CONTENTS_LOC = "src/main/resources/testfiles/small.txt";
public static final String MEDIUM_CONTENTS_LOC = "src/main/resources/testfiles/medium.txt";
public static final String LARGE_CONTENTS_LOC = "src/main/resources/testfiles/large.txt";
public static final String STATE_META_JSON_LOC = "src/main/resources/testfiles/diverseBlobsInfo.json";

public static void main(String... args) throws IOException {
new DiverseStateCreation().runSuiteSync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
public class UpdateServerFiles extends HapiSuite {
private static final Logger log = LogManager.getLogger(UpdateServerFiles.class);
private static final String zipFile = "Archive.zip";
private static final String DEFAULT_SCRIPT = "src/main/resource/testfiles/updateFeature/updateSettings/exec.sh";
private static final String DEFAULT_SCRIPT = "src/main/resources/testfiles/updateFeature/updateSettings/exec.sh";

private static String uploadPath = "updateFiles/";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ host=localhost
#Start up Account file
#
##Enable below for localhost Account Startup File for Genesis Account
startUpFile=src/main/resource/StartUpAccount.txt
startUpFile=src/main/resources/StartUpAccount.txt
#
##Enable below for Test Net Account Startup File for AccountNum=
#startUpFile=src/main/resource/TestNet_AccountForTestsStartUp.txt
#startUpFile=src/main/resources/TestNet_AccountForTestsStartUp.txt
#
##Enable below for Main Net Account Startup File for AccountNum=
#startUpFile=src/main/resource/MainNet_AccountForTestsStartUp.txt
#startUpFile=src/main/resources/MainNet_AccountForTestsStartUp.txt
#
#startUpFile=src/main/resource/OpenCrowd_8013_AccountForTestsStartUp.txt
#startUpFile=src/main/resources/OpenCrowd_8013_AccountForTestsStartUp.txt
#
# default REALM/SHARD properties
NODE_REALM_NUMBER = 0
Expand Down
Loading

0 comments on commit 1fe6a2d

Please sign in to comment.