Skip to content

Commit

Permalink
wip first pass at test reports
Browse files Browse the repository at this point in the history
  • Loading branch information
fastfadingviolets committed Jan 16, 2025
1 parent 26fec1c commit 9ef3885
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/interchain-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
echo "tag_name=${{ github.event.client_payload.tag_name }}" | tee -a $GITHUB_OUTPUT
else
echo "ref_name=${{ github.ref_name }}" | tee -a $GITHUB_OUTPUT
echo "tag_name=${{ github.ref_name }}" | tee -a $GITHUB_OUTPUT
echo "tag_name=${{ github.ref_name }}" | sed 's~/~-~g' | tee -a $GITHUB_OUTPUT
fi
- name: Check out repository code
uses: actions/checkout@v4
Expand Down Expand Up @@ -61,4 +61,32 @@ jobs:
# Once we're testing 19 -> 20 this can be removed
docker pull "ghcr.io/hyphacoop/gaia:v18.1.0" && docker tag "ghcr.io/hyphacoop/gaia:v18.1.0" "ghcr.io/${{ github.repository_owner }}/gaia:v18.1.0"
cd ./tests/interchain
go test -v ./... -failfast -p 1 -timeout 5h -run="^${{ matrix.test_name }}"
go install github.com/mfridman/tparse@latest
go test -v ./... -failfast -p 1 -timeout 5h -run="^${{ matrix.test_name }}" -json | tee ../../output-${{ matrix.previous_version }}-${{ matrix.test_name }}.json | tparse -follow -all
- name: Upload output
uses: actions/upload-artifact@v4
if: always()
with:
name: output-${{ matrix.previous_version }}-${{ matrix.test_name }}.json
path: output-${{ matrix.previous_version }}-${{ matrix.test_name }}.json
test-report:
needs: test
if: always()
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./outputs
- name: Setup go
uses: actions/setup-go@v5
- name: Prep report
run: |
go install github.com/vakenbolt/go-test-report@latest
cat ./outputs/output-*.json > combined.json
go-test-report < combined.json
- name: Upload output
uses: actions/upload-artifact@v4
with:
name: test_report
path: test_report.html
10 changes: 6 additions & 4 deletions tests/interchain/matrix_tool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func GetPreviousMajorMinor(ctx context.Context, testVersion string) (previousVer
org = "cosmos"
}
client := github.NewClient(nil)
releaes, _, err := client.Repositories.ListReleases(ctx, org, "gaia", nil)
releases, _, err := client.Repositories.ListReleases(ctx, org, "gaia", nil)
if err != nil {
err = fmt.Errorf("ListReleases failed: %w", err)
return
Expand All @@ -40,8 +40,8 @@ func GetPreviousMajorMinor(ctx context.Context, testVersion string) (previousVer
err = fmt.Errorf("failed to parse major version: %w", err)
return
}
semvers := make([]string, 0, len(releaes))
for _, release := range releaes {
semvers := make([]string, 0, len(releases))
for _, release := range releases {
semvers = append(semvers, release.GetTagName())
}
var previousMinor, previousRc bool
Expand Down Expand Up @@ -97,6 +97,7 @@ func GetSemverForBranch() (string, error) {

func GetTestList() ([]string, error) {
retval := []string{}
uniq := map[string]bool{}
cmd := exec.Command("go", "test", "-list=.", "./...")
out, err := cmd.Output()
if err != nil {
Expand All @@ -105,8 +106,9 @@ func GetTestList() ([]string, error) {
}
lines := strings.Split(string(out), "\n")
for _, line := range lines {
if strings.HasPrefix(line, "Test") {
if strings.HasPrefix(line, "Test") && !uniq[line] {
retval = append(retval, line)
uniq[line] = true
}
}
rand.Shuffle(len(retval), func(i, j int) {
Expand Down

0 comments on commit 9ef3885

Please sign in to comment.