Skip to content

Commit

Permalink
Merge branch 'nephio-project:main' into error_test_completed
Browse files Browse the repository at this point in the history
  • Loading branch information
Catalin-Stratulat-Ericsson authored Feb 26, 2024
2 parents bd392b4 + 74a3c57 commit 794d021
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 56 deletions.
7 changes: 1 addition & 6 deletions .mockery.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
packages:
github.com/nephio-project/nephio/controllers/pkg/giteaclient:
interfaces:
GiteaClient:
config:
dir: "{{.InterfaceDir}}"
with-expecter: true
19 changes: 1 addition & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,4 @@ unit-clean: ## These targets are delegated to the Makefiles of individual Go mod
docker-build docker-push: ## These targets are delegated to the Makefiles next to Dockerfiles
for dir in $(DOCKERFILE_DIRS); do \
$(MAKE) -C "$$dir" $@ ; \
done


##@ Mockery code

.PHONY: install-mockery
install-mockery: ## install mockery
ifeq ($(CONTAINER_RUNNABLE), 0)
$(CONTAINER_RUNTIME) pull docker.io/vektra/mockery:v${MOCKERY_VERSION}
else
wget -qO- https://github.com/vektra/mockery/releases/download/v${MOCKERY_VERSION}/mockery_${MOCKERY_VERSION}_${OS}_${OS_ARCH}.tar.gz | sudo tar -xvzf - -C /usr/local/bin
endif

.PHONY: generate-mocks
generate-mocks:
for dir in $(GO_MOD_DIRS); do \
$(MAKE) -C "$$dir" $@ || true ; \
done
done
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ deploying and managing highly distributed, interconnected workloads such as 5G
Network Functions, and the underlying infrastructure on which those workloads
depend.


[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nephio-project/nephio/badge)](https://securityscorecards.dev/viewer/?uri=github.com/nephio-project/nephio)

The R1 Release is now available! To get started with Nephio, view the [docs repo](https://github.com/nephio-project/docs)
which contains the [R1 Demo installation instructions](https://github.com/nephio-project/docs/blob/main/install-guide/README.md)
and [Quick start exercises](https://github.com/nephio-project/docs/blob/main/user-guide/exercises.md).
An announcement from The Linux Foundation regarding the release can be found
[here](https://www.linuxfoundation.org/press/nephio-community-gains-momentum-with-release-1-to-simplify-cloud-native-network-automation).

To get started with Nephio, view the [documentation website](https://docs.nephio.org/docs/)
which contains the [Demo installation instructions](https://docs.nephio.org/docs/guides/install-guides/)
and Quick Start Exercises for [Free5GC](https://docs.nephio.org/docs/guides/user-guides/exercise-1-free5gc/)
and [OAI](https://docs.nephio.org/docs/guides/user-guides/exercise-2-oai/).


To learn more about the Nephio project, refer to the [Learning with Nephio](https://www.youtube.com/playlist?list=PLiW9_IXAWtkt8lbFe1jF_bzEI4gd-Jlq4)
series and it's corresponding [wiki pages](https://wiki.nephio.org/display/HOME/Learning+with+Nephio+R1).

Expand Down
13 changes: 0 additions & 13 deletions controllers/pkg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,3 @@ include ../../default-go.mk

# This includes the 'help' target that prints out all targets with their descriptions organized by categories
include ../../default-help.mk

# This includes the below targets for mockery
# install-mockery
# generate-mocks
include ../../default-mockery.mk
.PHONY: generate-mocks
generate-mocks:
ifeq ($(CONTAINER_RUNNABLE), 0)
echo ${PWD}
$(CONTAINER_RUNTIME) run --security-opt label=disable -v ${PWD}:/src -w /src/controllers/pkg docker.io/vektra/mockery:v${MOCKERY_VERSION}
else
mockery
endif
14 changes: 14 additions & 0 deletions controllers/pkg/porch/condition/condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ func TestPackageRevisionIsReady(t *testing.T) {
},
want: true,
},
"Condition type not present": {
conds: []porchv1alpha1.Condition{
{
Type: "myterriblecondition",
Status: porchv1alpha1.ConditionStatus(porchv1alpha1.ConditionFalse),
},
},
readyGates: []porchv1alpha1.ReadinessGate{
{
ConditionType: "notmyterriblecondition",
},
},
want: false,
},
"Not ready": {
conds: []porchv1alpha1.Condition{
{
Expand Down
17 changes: 0 additions & 17 deletions default-go-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


GO_VERSION ?= 1.20.2
MOCKERY_VERSION=2.37.1
TEST_COVERAGE_FILE=lcov.info
TEST_COVERAGE_HTML_FILE=coverage_unit.html
TEST_COVERAGE_FUNC_FILE=func_coverage.out
Expand All @@ -39,22 +38,6 @@ else
go tool cover -func=${TEST_COVERAGE_FILE} -o ${TEST_COVERAGE_FUNC_FILE}
endif

.PHONY: install-mockery
install-mockery: ## install mockery
ifeq ($(CONTAINER_RUNNABLE), 0)
$(CONTAINER_RUNTIME) pull docker.io/vektra/mockery:v${MOCKERY_VERSION}
else
wget -qO- https://github.com/vektra/mockery/releases/download/v${MOCKERY_VERSION}/mockery_${MOCKERY_VERSION}_${OS}_${OS_ARCH}.tar.gz | sudo tar -xvzf - -C /usr/local/bin
endif

.PHONY: generate-mocks
generate-mocks:
ifeq ($(CONTAINER_RUNNABLE), 0)
$(CONTAINER_RUNTIME) run --security-opt label=disable -v ${PWD}:/src -w /src docker.io/vektra/mockery:v${MOCKERY_VERSION}
else
mockery
endif

.PHONY: unit-clean
unit-clean: ## Clean up the artifacts created by the unit tests
ifeq ($(CONTAINER_RUNNABLE), 0)
Expand Down
1 change: 1 addition & 0 deletions default-go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ include $(GIT_ROOT_DIR)/default-go-misc.mk
include $(GIT_ROOT_DIR)/default-go-test.mk
include $(GIT_ROOT_DIR)/default-go-lint.mk
include $(GIT_ROOT_DIR)/default-gosec.mk
include $(GIT_ROOT_DIR)/default-mockery.mk
24 changes: 23 additions & 1 deletion default-mockery.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,30 @@
# limitations under the License.


MOCKERY_VERSION=2.37.1
MOCKERY_VERSION=2.41.0
GIT_ROOT_DIR ?= $(dir $(lastword $(MAKEFILE_LIST)))
OS_ARCH ?= $(shell uname -m)
OS ?= $(shell uname)
include $(GIT_ROOT_DIR)/detect-container-runtime.mk

.PHONY: install-mockery
install-mockery: ## install mockery
ifeq ($(CONTAINER_RUNNABLE), 0)
$(CONTAINER_RUNTIME) pull docker.io/vektra/mockery:v${MOCKERY_VERSION}
else
wget -qO- https://github.com/vektra/mockery/releases/download/v${MOCKERY_VERSION}/mockery_${MOCKERY_VERSION}_${OS}_${OS_ARCH}.tar.gz | sudo tar -xvzf - -C /usr/local/bin
endif

.PHONY: generate-mocks
generate-mocks:
ifeq ($(CONTAINER_RUNNABLE), 0)
find . -name .mockery.yaml \
-exec echo generating mocks specified in {} . . . \; \
-execdir $(CONTAINER_RUNTIME) run --security-opt label=disable -v .:/src -w /src docker.io/vektra/mockery:v${MOCKERY_VERSION} \; \
-exec echo generated mocks specified in {} \;
else
find . -name .mockery.yaml \
-exec echo generating mocks specified in {} . . . \; \
-execdir mockery \; \
-exec echo generated mocks specified in {} \;
endif
2 changes: 1 addition & 1 deletion testing/mockeryutils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ all: fmt lint gosec
include ../../default-go.mk

# This includes the 'help' target that prints out all targets with their descriptions organized by categories
include ../../default-help.mk
include ../../default-help.mk

0 comments on commit 794d021

Please sign in to comment.