예제 #1
0
func main() {
	flag.Parse()

	runner := command_runner.New(true)
	tester := helpers.NewAppSizeBinarySearchTester(runner, *assetPath)

	value := helpers.BinarySearch(tester, *lowLimit, *highLimit, *tolerance)
	fmt.Printf("The biggest app I was able to push was %dM", value)
	return
}
예제 #2
0
			app, err := NewBigApp(runner, assetPath, 0)
			Expect(err).To(BeNil())

			app.Push()

			expectedCommand := fake_command_runner.CommandSpec{Path: "gcf", Args: []string{"push", app.Name, "-p", app.Location}}

			Expect(runner).To(HaveExecutedSerially(expectedCommand))
		})
	})

	Describe("NewBigApp", func() {
		var app *BigApp

		BeforeEach(func() {
			runner := command_runner.New(false)

			var err error
			app, err = NewBigApp(runner, assetPath, 5)
			Expect(err).To(BeNil())
		})

		AfterEach(func() {
			err := os.RemoveAll(app.Location)
			Expect(err).To(BeNil())
		})

		It("copies the app asset", func() {
			files, err := ioutil.ReadDir(app.Location)
			Expect(err).To(BeNil())