e2e-framework icon indicating copy to clipboard operation
e2e-framework copied to clipboard

structured data output

Open jayunit100 opened this issue 3 years ago • 8 comments

@perithompson would like to dump YAML From table tests such as the https://github.com/K8sbykeshed/k8s-service-lb-validator/ frameowrk, could we do something like:

Taking a struct such as this, it would be nice to directly put it into test output as a readable/exported entity

// Reachability packages the data for a cluster-wide connectivity probe
type Reachability struct {
	Expected []string
	Observed []string
	Pods     []*Pod
}

... psuedo code made with @vladimirvivien @jackielii


type MyYAML struct {}

// making a new programming language uup again for Jaice to parse
func (Writer* y) MyYAML(interface{} tableOutput) string {
    for blah,_ := tableOutput (*MyTable) {
        s += result + "\n"
    }
    return s
}

func myTest() {
  e := env.NewWithConfig(envconf.New())
	  feat := features.New("Hello Feature").
		  WithLabel("type", "simple").
		  Assess("test message", func(ctx context.Context, t *testing.T, _ *envconf.Config) context.Context {
			  result := Hello("foo")
			  if result != "Hello foo" {
				  t.Error("unexpected message")
			  }
			  return ctx
		  })
  
	  e.WithOutputWriter(Test(t, feat.Feature()), MyYAML())
}



jayunit100 avatar Sep 13 '21 16:09 jayunit100

Could this be handled with the -json output from the go test command ?

vladimirvivien avatar Dec 02 '21 18:12 vladimirvivien

FWIW I just did a basic structured output in the afterEachTest section. Just writes the test name and pass/fail. Gives at least some basic structure to that data and you can dig into the larger tables manually still. See https://github.com/K8sbykeshed/k8s-service-validator/pull/114

johnSchnake avatar Jan 20 '22 19:01 johnSchnake

@johnSchnake that is great. I looked at the code (link you provided). It got me thinking maybe it is worth exploring metrics collection and structured output. There's probably a package out there (OpenMetrics, Promethues, maybe)

vladimirvivien avatar Jan 20 '22 22:01 vladimirvivien

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Apr 20 '22 23:04 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar May 21 '22 00:05 k8s-triage-robot

/remove-lifecycle rotten

ShwethaKumbla avatar Jun 13 '22 07:06 ShwethaKumbla

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 11 '22 07:09 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Oct 11 '22 07:10 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Nov 10 '22 08:11 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Nov 10 '22 08:11 k8s-ci-robot