reports

package module
v0.0.0-...-c778d31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

README

SDK Feature Report Generator

This tool reads junit XML reports from different SDKs and generates an HTML report showing which SDKs support which features.

./cmd/build-html will iterate over the repos listed in sdk.go and download the most recent junit artifact. It will read all junit results from it and produce a report to _site/index.html. For local testing, generate a GitHub Personal Access Token and put it in an environment variable named GITHUB_TOKEN. It doesn't need any special permissions ("Public Repositories (read-only)"). Note that a GitHub app (explained below) can also be used.

./cmd/sync-vectors will check the main branch of all SDKs listed in sdks.go and ensure their vectors match the ones in this repo. For local testing, a GitHub App must be created. Put it's credentials in the following environment variables:

  • CICD_ROBOT_GITHUB_APP_ID - shown on the edit page of the app, where you are sent right after app creation.
  • CICD_ROBOT_GITHUB_APP_PRIVATE_KEY - this should be the contents of the private key, not the path to the file.
  • CICD_ROBOT_GITHUB_APP_NAME - this is used as a display name and should match the name in the URL of the edit page for the app.
  • CICD_ROBOT_GITHUB_APP_INSTALLATION_ID - click "Install App" on the sidebar while editing the app in GitHub to install it on your own account.

Tooling

This project uses hermit, an open source toolchain manager, which pins and automatically downloads and installs tooling for a repo, including compiler toolchains, utilities, etc.

To install hermit, run:

https://github.com/cashapp/hermit/releases/download/stable/install.sh | /bin/bash

If using goland or intellij, also install the hermit plugin via these instructions.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupported = errors.New("test not supported by this SDK")
)
View Source
var (
	SDKs = []SDKMeta{
		{
			Name:         "web5-js",
			Repo:         "TBD54566975/web5-js",
			ArtifactName: "junit-results",
			FeatureRegex: regexp.MustCompile(`Web5TestVectors(\w+)`),
			VectorRegex:  regexp.MustCompile(`.* Web5TestVectors\w+ (\w+)`),
			VectorPath:   "test-vectors",
			Type:         "web5",
		},
		{
			Name:         "web5-kt",
			Repo:         "TBD54566975/web5-kt",
			ArtifactName: "test-results",
			FeatureRegex: regexp.MustCompile(`web5\.sdk\.\w+.Web5TestVectors(\w+)`),
			VectorRegex:  regexp.MustCompile(`(\w+)\(\)`),
			VectorPath:   "test-vectors",
			Type:         "web5",
		},
		{
			Name:         "tbdex-js",
			Repo:         "TBD54566975/tbdex-js",
			ArtifactName: "junit-results",
			FeatureRegex: regexp.MustCompile(`TbdexTestVectors(\w+)`),
			VectorRegex:  regexp.MustCompile(`.* TbdexTestVectors\w+ (\w+)`),
			VectorPath:   "test-vectors",
			Type:         "tbdex",
		},
		{
			Name:         "tbdex-kt",
			Repo:         "TBD54566975/tbdex-kt",
			ArtifactName: "test-results",
			FeatureRegex: regexp.MustCompile(`tbdex\.sdk\.\w+.TbdexTestVectors(\w+)`),
			VectorRegex:  regexp.MustCompile(`(\w+)\(\)`),
			VectorPath:   "test-vectors",
			Type:         "tbdex",
		},
	}
)

Functions

func CleanupGitAuth

func CleanupGitAuth() error

func ConfigureGitAuth

func ConfigureGitAuth() error

func SyncSDK

func SyncSDK(sdk SDKMeta) error

func WriteHTML

func WriteHTML(reports []Report, filename string) error

Types

type Report

type Report struct {
	SDK     SDKMeta
	Results map[string]map[string]Result
}

func GetAllReports

func GetAllReports() ([]Report, error)

func (Report) IsPassing

func (r Report) IsPassing() bool

type Result

type Result struct {
	Exists bool
	Errors []error
	Time   time.Duration
}

func (Result) GetEmoji

func (r Result) GetEmoji() string

func (Result) GetEmojiAriaLabel

func (r Result) GetEmojiAriaLabel() string

func (Result) IsSkipped

func (r Result) IsSkipped() bool

type SDKMeta

type SDKMeta struct {
	Name         string
	Repo         string
	ArtifactName string
	FeatureRegex *regexp.Regexp
	VectorRegex  *regexp.Regexp
	VectorPath   string
	Type         string
}

Directories

Path Synopsis
cmd
build-html command
sync-vectors command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL