Files
odo/scripts/mockgen.sh
Philippe Martin 9a239c4e77 Use a single handler for executing all commands (#6826)
* Document current implementations of command handlers

* Add unit tests for execHAndler

* Refactor pkg/devfile/image to inject Backend as dependency

* Use same handler for kubedev/podmandev

* Fail after SelectBackend==nil only if backend is needed

* Move runHandler to dev/common

* Unit tests for runHandler

* Create a component.ExecuteTerminatingCommand

* ExecuteTerminatingCommand/ExecuteNonTerminatingCommand for Handler

* Fix calling other command types

* Consider parent group to determine if a command is terminating

* Replace component.execHandler by common.runHandler

* Remove execHandler

* Make runHandler and most of fields private and pass containersRunning to handler

* Pass containersRunning value

* deploy using common Handler

* Fix tests

* Use specific Dev/Deploy mode for Apply

* Fix cmdline for job

* Fix unit tests

* Pass appName and componentName with ctx to handler

* Move handler to pkg/component package

* Update doc

* Unit tests Deploy

* Unit tests Build

* Unit tests Run

* Unit tests PostStart

* Unit tests PreStop

* Update doc

* Fix Podman tests

* Fix hotReload on podman

* Change podman version timeout to 30s for tests

* Cleanup + fix doc
2023-05-26 11:01:21 -04:00

106 lines
2.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# Use this script to regenerate generated mock files
# after changing signatures of interfaces in these packages
gomockVersion=$(go list -mod=readonly -m -f '{{.Version}}' github.com/golang/mock)
mockgen="go run -mod=readonly github.com/golang/mock/mockgen@$gomockVersion"
echo Using mockgen "$($mockgen --version)"
$mockgen -source=pkg/kclient/interface.go \
-package kclient \
-destination pkg/kclient/mock_Client.go
$mockgen -source=pkg/storage/storage.go \
-package storage \
-destination pkg/storage/mock_Client.go
$mockgen -source=pkg/devfile/image/image.go \
-package image \
-destination pkg/devfile/image/mock_Backend.go
$mockgen -source=pkg/odo/cmdline/cmdline.go \
-package cmdline \
-destination pkg/odo/cmdline/mock.go
$mockgen -source=pkg/project/project.go \
-package project \
-destination pkg/project/mock.go
$mockgen -source=pkg/preference/preference.go \
-package preference \
-destination pkg/preference/mock.go
$mockgen -source=pkg/auth/interface.go \
-package auth \
-destination pkg/auth/mock.go
$mockgen -source=pkg/init/backend/interface.go \
-package backend \
-destination pkg/init/backend/mock.go
$mockgen -source=pkg/init/asker/interface.go \
-package asker \
-destination pkg/init/asker/mock.go
$mockgen -source=pkg/init/interface.go \
-package init \
-destination pkg/init/mock.go
$mockgen -source=pkg/registry/interface.go \
-package registry \
-destination pkg/registry/mock.go
$mockgen -source=pkg/deploy/interface.go \
-package deploy \
-destination pkg/deploy/mock.go
$mockgen -source=pkg/libdevfile/libdevfile.go \
-package libdevfile \
-destination pkg/libdevfile/handler_mock.go
$mockgen -source=pkg/watch/interface.go \
-package watch \
-destination pkg/watch/mock.go
$mockgen -source=pkg/component/delete/interface.go \
-package delete \
-destination pkg/component/delete/mock.go
$mockgen -source=pkg/dev/interface.go \
-package dev \
-destination pkg/dev/mock.go
$mockgen -source=pkg/alizer/interface.go \
-package alizer \
-destination pkg/alizer/mock.go
$mockgen -source=pkg/binding/interface.go \
-package binding \
-destination pkg/binding/mock.go
$mockgen -source=pkg/binding/backend/interface.go \
-package backend \
-destination pkg/binding/backend/mock.go
$mockgen -source=pkg/sync/interface.go \
-package sync \
-destination pkg/sync/mock.go
$mockgen -source=pkg/exec/interface.go \
-package exec \
-destination pkg/exec/mock.go
$mockgen -source=pkg/podman/interface.go \
-package podman \
-destination pkg/podman/mock.go
$mockgen -source=pkg/configAutomount/interface.go \
-package configAutomount \
-destination pkg/configAutomount/mock.go
$mockgen -source=pkg/platform/interface.go \
-package platform \
-destination pkg/platform/mock.go