// prepareBundle downloads the bundle, uncompresses it and removes undesired files.
prepareBundle downloads the bundle, uncompresses it and removes undesired files.
// prepareBundle downloads the bundle uncompresses it and removes undesired files .
func (e *Executor) prepareBundle() error {
	if _, err := e.FileService.DownloadFile(filePathCompressedBundle, e.BundleRequestURL, e.BundleRequestHeaders); err != nil {
		return fmt.Errorf("error downloading compressed problem bundle for execution: %w", err)
	}
	if err := e.FileService.Uncompress(filePathCompressedBundle, "."); err != nil {
		return fmt.Errorf("error uncompressing problem bundle for execution: %w", err)
	}
	if err := e.FileService.RemoveFileTree(filePathCompressedBundle); err != nil {
		return fmt.Errorf("error removing compressed problem bundle for execution: %w", err)
	}
	if err := e.FileService.RemoveFileTree(folderPathBundleOutputs); err != nil {
		return fmt.Errorf("error removing correct outputs for execution: %w", err)
	}
	var err error
	e.testCases, err = listTestCases(e.FileService)
	if err != nil {
		return fmt.Errorf("error listing test cases: %w", err)
	}
	e.numTestCases = len(e.testCases)
	return nil
}
func ( e * Executor ) prepareBundle ( ) error { if _ , err := e . FileService . DownloadFile ( filePathCompressedBundle , e . BundleRequestURL , e . BundleRequestHeaders ) ; err != nil { return fmt . Errorf ( " " , err ) } if err := e . FileService . Uncompress ( filePathCompressedBundle , " " ) ; err != nil { return fmt . Errorf ( " " , err ) } if err := e . FileService . RemoveFileTree ( filePathCompressedBundle ) ; err != nil { return fmt . Errorf ( " " , err ) } if err := e . FileService . RemoveFileTree ( folderPathBundleOutputs ) ; err != nil { return fmt . Errorf ( " " , err ) } var err error e . testCases , err = listTestCases ( e . FileService ) if err != nil { return fmt . Errorf ( " " , err ) } e . numTestCases = len ( e . testCases ) return nil }
prepareBundle downloads the bundle, uncompresses it and removes undesired files.
prepareBundle downloads the bundle uncompresses it and removes undesired files .