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: profiles_test.go
    path of file: ./repos/arduino-cli/internal/integrationtest/profiles
    
    the code of the file until where you have to start completion: // This file is part of arduino-cli.
//
// Copyright 2022 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-cli.
// The terms of th
    
func TestCompileWithProfiles(t *testing.T) {
	env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
	defer env.CleanUp()

	// Init the environment explicitly
	_, _, err := cli.Run("core", "update-index")
	require.NoError(t, err)

	// copy sketch_with_profile into the working directory
	sketchPath := cli.CopySketch("sketch_with_profile")

	// use profile without a required library -> should fail
	_, _, err = cli.Run("lib", "install", "Arduino_JSON")
	require.NoError(t, err)
	_, _, err = cli.Run("compile", "-m", "avr1", sketchPath.String())
	require.Error(t, err)

	// use profile with the required library -> should succeed
	_, _, err = cli.Run("compile", "-m", "avr2", sketchPath.String())
	require.NoError(t, err)
}