Skip to content

Commit

Permalink
Test results artifacts (#6585)
Browse files Browse the repository at this point in the history
* wildcard in place of task name in path, in case it gets changed.
* test splitting action is unreliable at these numbers of tests
* pin to new gradle action, increase runners
* found the missing tests, back to parity
* rename to avoid consolidation status collision with workflow name
* fixes javadoc checks at build time
* overrides project version on release, so embeds (startup info) will match release artifacts


---------

Signed-off-by: Justin Florentine <[email protected]>
Co-authored-by: RoboCopsGoneSock <[email protected]>
  • Loading branch information
jflo and RoboCopsGoneSock authored Feb 18, 2024
1 parent 9e2f471 commit 737d931
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ jobs:
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: acceptance-node-${{matrix.runner_index}}-test-results
path: 'acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml'
path: 'acceptance-tests/tests/build/test-results/**/TEST-*.xml'
- name: Publish Test Report
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5
if: (success() || failure()) # always run even if the build step fails
with:
report_paths: 'acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml'
report_paths: 'acceptance-tests/tests/build/test-results/**/TEST-*.xml'
annotate_only: true
acceptance-tests:
accepttests-passed:
runs-on: ubuntu-22.04
needs: [ acceptanceTestEthereum ]
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa
- name: assemble distributions
run:
./gradlew -Prelease.releaseVersion=${{github.ref_name}} assemble -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
./gradlew -Prelease.releaseVersion=${{github.ref_name}} -Pversion=${{github.ref_name}} assemble -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
- name: hashes
id: hashes
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ jobs:
env:
architecture: ${{ steps.prep.outputs.ARCH }}
with:
arguments: testDocker -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Prelease.releaseVersion=${{ github.ref_name }}
arguments: testDocker -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Pversion=${{github.ref_name}} -Prelease.releaseVersion=${{ github.ref_name }}
- name: publish
env:
architecture: ${{ steps.prep.outputs.ARCH }}
run: ./gradlew --no-daemon dockerUpload -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Prelease.releaseVersion=${{ github.ref_name }}
run: ./gradlew --no-daemon dockerUpload -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Pversion=${{github.ref_name}} -Prelease.releaseVersion=${{ github.ref_name }}
multiArch:
needs: buildDocker
runs-on: ubuntu-22.04
Expand All @@ -109,5 +109,5 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: multi-arch docker
run: ./gradlew manifestDocker -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Prelease.releaseVersion=${{ github.ref_name }}
run: ./gradlew manifestDocker -PdockerOrgName=${{ env.registry }}/${{ github.repository_owner }} -Pversion=${{github.ref_name}} -Prelease.releaseVersion=${{ github.ref_name }}

3 changes: 2 additions & 1 deletion .github/workflows/pre-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
- "ethereum:api:testBonsai"
- "ethereum:api:testForest"
- "ethereum:api:testRemainder"
- "ethereum:eth:test"
- "ethereum:core:test"
steps:
- name: Checkout Repo
Expand All @@ -100,7 +101,7 @@ jobs:
with:
report_paths: '**/test-results/**/TEST-*.xml'
annotate_only: true
pre-review:
unittests-passed:
runs-on: ubuntu-22.04
needs: [unitTests]
permissions:
Expand Down
36 changes: 15 additions & 21 deletions .github/workflows/reference-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false"
total-runners: 6
total-runners: 10

jobs:
shouldRun:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
strategy:
fail-fast: true
matrix:
runner_index: [0,1,2,3,4,5]
runner_index: [1,2,3,4,5,6,7,8,9,10]
steps:
- name: Checkout Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand All @@ -76,29 +76,23 @@ jobs:
with:
distribution: adopt-openj9
java-version: 17
- name: get reference test report
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
with:
branch: main
name_is_regexp: true
name: 'reference-test-node-\d*\d-results'
path: tmp/ref-xml-reports-downloaded
if_no_artifact_found: true
- name: setup gradle
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa
uses: gradle/actions/setup-gradle@9e899d11ad247ec76be7a60bc1cf9d3abbb9e7f1
#shame the test generation isn't less redundant, we used to do this in a dependent job, but artifact downloading broke
- name: execute generate reference tests
run: ./gradlew ethereum:referencetests:blockchainReferenceTests ethereum:referencetests:generalstateReferenceTests ethereum:referencetests:generalstateRegressionReferenceTests -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
- name: list test files generated
run: find ethereum/referencetests/build/generated/sources/reference-test -name "*.java" | sort >> filenames.txt
- name: Split tests
id: split-tests
uses: r7kamura/split-tests-by-timings@9322bd292d9423e2bc5a65bec548901801341e3f
with:
reports: tmp/ref-xml-reports-downloaded
glob: 'ethereum/referencetests/build/generated/sources/reference-test/**/*.java'
total: ${{env.total-runners}}
index: ${{ matrix.runner_index }}
run: ./.github/workflows/splitList.sh filenames.txt ${{env.total-runners}}
- name: echo test file count
run: cat group_${{matrix.runner_index}}.txt | wc
- name: convert to test suite classnames
run: cat group_${{matrix.runner_index}}.txt | sed -e 's/^.*java\///' -e 's@/@.@g' -e 's/\.java//' -e 's/^/--tests /' > testClasses.txt
- name: compose gradle args
run: echo ${{ steps.split-tests.outputs.paths }} | sed -e 's/^.*java\///' -e 's@/@.@g' -e 's/\.java//' -e 's/^/--tests /' > refTestArgs.txt
run: tr '\n' ' ' < testClasses.txt > refTestArgs.txt
- name: refTestArgs.txt
run: cat refTestArgs.txt
- name: run reference tests
run: ./gradlew ethereum:referenceTests:referenceTests `cat refTestArgs.txt` -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
- name: Upload Test Report
Expand All @@ -111,9 +105,9 @@ jobs:
uses: mikepenz/action-junit-report@5f47764eec0e1c1f19f40c8e60a5ba47e47015c5
if: success() || failure() # always run even if the build step fails
with:
report_paths: '**/build/test-results/referenceTest/TEST-*.xml'
report_paths: '**/build/test-results/referenceTests/TEST-*.xml'
annotate_only: true
reference-tests:
reftests-passed:
runs-on: ubuntu-22.04
needs: [ referenceTestEthereum ]
permissions:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/splitList.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
N=$2 # Number of groups
i=0 # Initialize counter
cat $1 | while read line; do
echo "$line" >> "group_$((i % N + 1)).txt"
let i++
done

Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ public void validate(final CommandLine commandLine) {
}
}

/**
* Converts to options from the configuration
*
* @param domainObject to be reversed
* @return the options that correspond to the configuration
*/
public static DataStorageOptions fromConfig(final DataStorageConfiguration domainObject) {
final DataStorageOptions dataStorageOptions = DataStorageOptions.create();
dataStorageOptions.dataStorageFormat = domainObject.getDataStorageFormat();
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ allprojects {
from javadoc.outputDirectory
}

tasks.build {
dependsOn 'javadoc'
}
sourceCompatibility = 17
targetCompatibility = 17

Expand Down Expand Up @@ -1039,7 +1042,6 @@ def calculateVersion() {
return version
}


def getCheckedOutGitCommitHash(length = 8) {
try {
def gitFolder = "$projectDir/.git/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ static Bytes longBytes(final long value) {
(byte) value);
}

/**
* Utility to decode string to unsigned long
*
* @param number to be decoded
* @return long value, unsigned
*/
static long decodeUnsignedLong(final String number) {
String parsable = number;
int radix = 10;
Expand Down

0 comments on commit 737d931

Please sign in to comment.