experiment/resultstore/upload.go
func upload(rsClient *resultstore.Client, inv resultstore.Invocation, target resultstore.Target, test resultstore.Test) (string, error) {

	targetID := test.Name
	const configID = resultstore.Default
	invName, err := rsClient.Invocations().Create(inv)
	if err != nil {
		return "", fmt.Errorf("create invocation: %v", err)
	}
	targetName, err := rsClient.Targets(invName).Create(targetID, target)
	if err != nil {
		return resultstore.URL(invName), fmt.Errorf("create target: %v", err)
	}
	url := resultstore.URL(targetName)
	_, err = rsClient.Configurations(invName).Create(configID)
	if err != nil {
		return url, fmt.Errorf("create configuration: %v", err)
	}
	ctName, err := rsClient.ConfiguredTargets(targetName, configID).Create(test.Action)
	if err != nil {
		return url, fmt.Errorf("create configured target: %v", err)
	}
	_, err = rsClient.Actions(ctName).Create("primary", test)
	if err != nil {
		return url, fmt.Errorf("create action: %v", err)
	}
	return url, nil
}
func upload(rsClient *resultstore.Client, inv resultstore.Invocation, target resultstore.Target, test resultstore.Test) (string, error) {

	targetID := test.Name
	const configID = resultstore.Default
	invName, err := rsClient.Invocations().Create(inv)
	if err != nil {
		return "", fmt.Errorf("create invocation: %v", err)
	}
	targetName, err := rsClient.Targets(invName).Create(targetID, target)
	if err != nil {
		return resultstore.URL(invName), fmt.Errorf("create target: %v", err)
	}
	url := resultstore.URL(targetName)
	_, err = rsClient.Configurations(invName).Create(configID)
	if err != nil {
		return url, fmt.Errorf("create configuration: %v", err)
	}
	ctName, err := rsClient.ConfiguredTargets(targetName, configID).Create(test.Action)
	if err != nil {
		return url, fmt.Errorf("create configured target: %v", err)
	}
	_, err = rsClient.Actions(ctName).Create("primary", test)
	if err != nil {
		return url, fmt.Errorf("create action: %v", err)
	}
	return url, nil
}
// upload the result downloaded from path into project.