You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: instructions_test.go
    path of file: ./repos/rancher/pkg/capr/planner
    
    the code of the file until where you have to start completion: package planner

import (
	"testing"

	v1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1"
	"github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1/plan"
	"github.com/rancher/rancher/pkg/capr"
	"github.com/rancher/rancher/pkg/provisioningv2/image"
	"
    
func TestPlanner_generateInstallInstruction(t *testing.T) {
	type args struct {
		version         string
		expectedVersion string
		os              string
		command         string
		scriptName      string
		envs            []string
		expectedEnvsLen int
		image           string
		expectedImage   string
	}

	tests := []struct {
		name string
		args args
	}{
		{
			name: "Checking Empty Linux Instructions",
			args: args{
				version:         "v1.21.5+rke2r2",
				expectedVersion: "v1.21.5-rke2r2",
				os:              "linux",
				command:         "sh",
				scriptName:      "run.sh",
				envs:            []string{},
				expectedEnvsLen: 1,
				image:           "my/custom-image-",
				expectedImage:   "my/custom-image-rke2:v1.21.5-rke2r2",
			},
		},
		{
			name: "Checking Empty Windows Instructions",
			args: args{
				version:         "v1.21.5+rke2r2",
				expectedVersion: "v1.21.5-rke2r2",
				os:              "windows",
				command:         "powershell.exe",
				scriptName:      "run.ps1",
				envs:            []string{},
				expectedEnvsLen: 1,
				image:           "my/custom-image-",
				expectedImage:   "my/custom-image-rke2:v1.21.5-rke2r2",
			},
		},
		{
			name: "Checking Linux Instructions",
			args: args{
				version:         "v1.21.5+rke2r2",
				expectedVersion: "v1.21.5-rke2r2",
				os:              "linux",
				command:         "sh",
				scriptName:      "run.sh",
				envs:            []string{"HTTP_PROXY", "HTTPS_PROXY", "INSTALL_RKE2_EXEC"},
				expectedEnvsLen: 3,
				image:           "my/custom-image-",
				expectedImage:   "my/custom-image-rke2:v1.21.5-rke2r2",
			},
		},
		{
			name: "Checking Windows Instructions",
			args: args{
				version:         "v1.21.5+rke2r2",
				expectedVersion: "v1.21.5-rke2r2",
				os:              "windows",
				command:         "powershell.exe",
				scriptName:      "run.ps1",
				envs:            []string{"$env:HTTP_PROXY", "$env:HTTPS_PROXY", "$env:INSTALL_RKE2_EXEC"},
				expectedEnvsLen: 3,
				image:           "my/custom-image-",
				expectedImage:   "my/custom-image-rke2:v1.21.5-rke2r2",
			},
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			// arrange
			a := assert.New(t)
			controlPlane := createTestControlPlane(tt.args.version)
			if len(tt.args.envs) != 0 {
				controlPlane.Spec.AgentEnvVars = []v1.EnvVar{{Name: "HTTP_PROXY", Value: "0.0.0.0"}, {Name: "HTTPS_PROXY", Value: "0.0.0.0"}}
			}
			entry := createTestPlanEntry(tt.args.os)
			var planner Planner
			planner.retrievalFunctions.SystemAgentImage = func() string { return tt.args.image }
			planner.retrievalFunctions.ImageResolver = image.ResolveWithControlPlane
			// act
			p := planner.generateInstallInstruction(controlPlane, entry, []string{})

			// assert
			a.NotNil(p)
			a.Contains(p.Command, tt.args.command)
			a.Contains(p.Args, tt.args.scriptName)
			a.Equal(p.Image, tt.args.expectedImage)
			a.Equal(tt.args.expectedEnvsLen, len(p.Env))
			for _, e := range tt.args.envs {
				a.True(findEnv(p.Env, e), "couldn't find %s in environment", e)
			}
		})
	}
}