Skip to content

Commit

Permalink
apply spotless
Browse files Browse the repository at this point in the history
Signed-off-by: georgi-l95 <[email protected]>
  • Loading branch information
georgi-l95 committed Sep 12, 2024
1 parent 2e610db commit e73b746
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 19 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
##
# Copyright (C) 2024 Hedera Hashgraph, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
name: "E2E Test Suites"
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- "*"

defaults:
run:
shell: bash

env:
GRADLE_EXEC: ./gradlew

jobs:
e2e-tests:
runs-on: block-node-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

- name: Expand Shallow Clone for Spotless
run: |
if [ -f .git/shallow ]; then
git fetch --unshallow --no-recurse-submodules
else
echo "Repository is not shallow, no need to unshallow."
fi
- name: Set up JDK 21
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: 'temurin'
java-version: '21'

- name: Build application
run: ${{ env.GRADLE_EXEC }} build

- name: Run Acceptance Tests
id: acceptance-tests
run: ${GRADLE_EXEC} acceptanceTest

3 changes: 1 addition & 2 deletions suites/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ mainModuleInfo {
runtimeOnly("org.junit.jupiter.engine")
}


tasks.register<Test>("runSuites") {
description = "Runs E2E Test Suites"
group = "suites"

useJUnitPlatform()
testClassesDirs = sourceSets["main"].output.classesDirs
classpath = sourceSets["main"].runtimeClasspath
}
}
19 changes: 11 additions & 8 deletions suites/src/main/java/com/hedera/block/suites/BaseSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@

package com.hedera.block.suites;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;

public abstract class BaseSuite {
@BeforeEach
public void setup() {

@BeforeAll
public static void setup() {
// initilize simulator
// initilize block node application
// start both applications
}

@AfterEach
public void teardown() {

@AfterAll
public static void teardown() {
// tear down and stop simulator
// tear down and stop block node app
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
import org.junit.platform.suite.api.Suite;

@Suite
@SelectClasses({
PositiveBlockStreamTests.class,
NegativeBlockStreamTests.class
})
@SelectClasses({PositiveBlockStreamTests.class, NegativeBlockStreamTests.class})
public class StreamTestSuites {
// This class only serves as a suite entry point; no need to add any logic here.
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@

package com.hedera.block.suites.stream.negative;

import static org.junit.jupiter.api.Assertions.assertFalse;

import com.hedera.block.suites.BaseSuite;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

@DisplayName("Positive Block Stream Tests")
@DisplayName("Negative Block Stream Tests")
public class NegativeBlockStreamTests extends BaseSuite {
@BeforeEach
public void prepare() {
System.out.println("NegativeBlockStreamTests Prepare");
}

@Test
public void testValidBlockStreamProcessing() {
System.out.println("testValidBlockStreamProcessing");
public void testInvalidBlockStreamProcessing() {
assertFalse(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

package com.hedera.block.suites.stream.positive;

import static org.junit.jupiter.api.Assertions.assertTrue;

import com.hedera.block.suites.BaseSuite;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

@DisplayName("Positive Block Stream Tests")
public class PositiveBlockStreamTests extends BaseSuite {

@Test
public void testValidBlockStreamProcessing() {
System.out.println("testValidBlockStreamProcessing");
assertTrue(true);
}
}

0 comments on commit e73b746

Please sign in to comment.