首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏运维开发故事

    Tekton系列之实践篇-我的第一条Pipeline

    cached) 所以这个Task,只需要一个Go环境,能执行Go命令即可,如下: apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: unit-test (params.revision) - name: gitInitImage value: $(params.gitInitImage) - name: unit-test 传递 workspaces - name: source workspace: go-repo-pvc taskRef: name: unit-test value: $(params.imageTag) taskRef: name: build-push-image runAfter: - unit-test (params.revision) - name: gitInitImage value: $(params.gitInitImage) - name: unit-test

    1.1K20编辑于 2022-04-05
  • 来自专栏LinkinStar's Blog

    Golang 单元测试 - 其他小技

    package main import ( "fmt" "testing" "github.com/agiledragon/gomonkey/v2" "go-demo/m/unit-test ok go-demo/m/unit-test/service 0.879s coverage: 70.0% of statements 还可以生成 profile 然后通过可视化网页查看分析 -coverprofile=cover.out ok go-demo/m/unit-test/service 0.108s coverage: 70.0% of statements

    1.1K30编辑于 2023-02-28
  • 来自专栏PingCAP的专栏

    Golang Failpoint 的设计与实现

    的激活与关闭 : failpoint.InjectContext(ctx, "failpoint-name", func(val failpoint.Value) { fmt.Println("unit-test 转换后的代码: if ok, val := failpoint.EvalContext(ctx, _curpkg_("failpoint-name")); ok { fmt.Println("unit-test (int) == 1000 { goto label1 // illegal to use goto here } fmt.Println("unit-test := func() { failpoint.Inject("failpoint-name", func(val failpoint.Value) { fmt.Println("unit-test { a() failpoint.Inject("failpoint-name-3", func(val failpoint.Value) { fmt.Println("unit-test

    2K20发布于 2019-05-05
  • 来自专栏信且诚心之动

    如何在本地Fabric release-2.2上快速make all成功

    available[/cleaned] # - unit-test-clean - cleans unit test state (particularly from docker) # - unit-test gotools.mk .PHONY: all all: check-go-version native docker checks .PHONY: checks checks: basic-checks unit-test unit-test: unit-test-clean docker-thirdparty-couchdb . /scripts/run-unit-tests.sh .PHONY: unit-tests unit-tests: unit-test # Pull thirdparty docker images .PHONY: profile profile: export JOB_TYPE=PROFILE profile: unit-test .PHONY: linter linter: check-deps

    1.1K20编辑于 2022-12-28
  • 来自专栏LinkinStar's Blog

    Golang 单元测试 - 逻辑层

    基本 case 代码 首先我们还是基于上一次的例子,这里给出上一次例子中所用到的接口 package service import ( "context" "fmt" "go-demo/m/unit-test Package mock is a generated GoMock package. package mock import ( context "context" entity "go-demo/m/unit-test context" "testing" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "go-demo/m/unit-test /entity" "go-demo/m/unit-test/mock" ) func TestUserService_AddUser(t *testing.T) { ctl := gomock.NewController

    72210编辑于 2023-02-22
  • 来自专栏FreeSWITCH中文社区

    ClueCon2022在芝加哥举行及FreeSWITCH1.10.8发布

    Add switch_buffer_zero_fill() core make switch_core_media_prepare_codecs() more unit-test friendly. core overflow on module load. mod_event_socket fix strcmp crash mod_http_cache``unit-tests remove timestamp unit-test explaining that we include switch_ssl.h into sofia_reg.c because of SHA-512-256 (RFC-8760) mod_sofia Unit-test Remove some fst_requires(). mod_ssml Add deps rule to the Makefile.am mod_test Increase tts_time unit-test's

    92220编辑于 2022-12-12
  • 来自专栏全栈程序员必看

    Gitlab-CICD最简单明了的入门教程

    比如下面这个图: 这里的四个Statge(阶段): Verify、Build、Dockerpush、Deploy四个,这四个阶段组成一条Pipeline 每个阶段都有一个job,所以总共四个job,也就是unit-test stage: verify # 属于哪个流程 tags: - test-cicd # 在哪个runner上面执行,在注册runner可以自定义 script: - echo unit-test 在注册Runner的过程中,我们可以设置Runner的标签,tags可通过tags来指定特殊的Runners来运行jobs: #单元测试 unit-test: stage: verify # 属于哪个流程 : stage: verify tags: - test-cicd script: - echo unit-test #java编译 java-package: stage : stage: verify tags: - test-cicd script: - echo unit-test #java编译 java-package: stage

    9K40编辑于 2022-09-07
  • 来自专栏运维开发故事

    Tekton实践篇-Tekton和Argocd的梦幻联动

    $(params.revision) - name: gitInitImage value: $(params.gitInitImage) - name: unit-test 传递 workspaces - name: source workspace: rd-repo-pvc taskRef: name: unit-test tasks.clone.results.commit) taskRef: name: build-push-image runAfter: - unit-test

    2.6K21编辑于 2022-05-23
  • 来自专栏LinkinStar's Blog

    Golang 单元测试 - 接口层

    代码这里就不赘述了 base case package controller import ( "context" "github.com/gin-gonic/gin" "go-demo/m/unit-test fmt" "testing" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "go-demo/m/unit-test /entity" "go-demo/m/unit-test/mock" ) func TestUserController_AddUser(t *testing.T) { ctl := gomock.NewController

    59540编辑于 2023-02-24
  • 来自专栏DevOps持续集成

    将自由风格项目转换为Pipeline项目CI/CD

    PATH=$PATH:/usr/local/go/bin:$GOPATH/bin make format make clean build if make unit-test path/repo1/dir else cd /var/jenkins/workspace/path/repo2/dir2 fi if make unit-test

    1.9K20编辑于 2021-12-15
  • 来自专栏DevOps持续集成

    将自由风格项目转换为管道项目 CI / CD

    PATH=$PATH:/usr/local/go/bin:$GOPATH/bin make format make clean build if make unit-test path/repo1/dir else cd /var/jenkins/workspace/path/repo2/dir2 fi if make unit-test

    1.2K20发布于 2020-04-22
  • 来自专栏yuyy.info技术专栏

    Gitlab CI/CD 实践七:公共脚本仓库

    │ │ └── .golangci.yml │ │ ├── .gitlab-ci.yml │ │ ├── .golangci.yml │ │ └── README.md │ └── unit-test

    97010编辑于 2022-10-04
  • 来自专栏blackheart的专栏

    [Cake] 0.C#Make自动化构建-简介

    /test/*/bin"); 6 }); 运行单元测试: 1 /// unit-test task 2 Task("unit-test") 3 .IsDependentOn("build") 4

    2K50发布于 2018-01-19
  • 来自专栏LinkinStar's Blog

    Golang 单元测试 - 数据层

    (这里仅给出最基本的实现,重点主要关注在单元测试上) package repo import ( "context" "go-demo/m/unit-test/entity" "xorm.io go-sql-driver/mysql" "github.com/ory/dockertest/v3" "github.com/ory/dockertest/v3/docker" "go-demo/m/unit-test 单元测试就变得简单了 package repo import ( "context" "testing" "github.com/stretchr/testify/assert" "go-demo/m/unit-test

    1.2K20编辑于 2023-02-22
  • 来自专栏啄木鸟软件测试

    变异测试

    self.assertEqual(mul(2, 2), 4) 4)运行 root@ubuntu:/home/jerry/muttest# mut.py --target calculator --unit-test root@ubuntu:/home/jerry/muttest# mut.py --target calculator --unit-test test_calculator -m [*] Start

    1.1K30编辑于 2022-05-22
  • 来自专栏运维开发故事

    Tekton系列之实践篇-由Jenkins改成Tekton

    $(params.revision) - name: gitInitImage value: $(params.gitInitImage) - name: unit-test 传递 workspaces - name: source workspace: rd-repo-pvc taskRef: name: unit-test tasks.clone.results.commit) taskRef: name: build-push-image runAfter: - unit-test

    1.2K20编辑于 2022-04-05
  • 来自专栏我的小碗汤

    14 张图详解构建全自动化 Helm 打包测试发布 CICD 流程

    以下是需要在管道中执行的步骤列表: helm在机器上安装 CLI(我们将使用cimg/base镜像作为测试执行器) 安装 Helm unit-test插件 运行单元测试 只有当我们在master分支中进行更改时 一旦我们安装了 helm CLI,我们就可以安装unit-test插件并运行单元测试。然后我们定义一个过滤master分支的规则。 : - checkout - helm/install-helm-client # (2) - run: name: Install Helm unit-test

    3.1K50编辑于 2023-03-20
  • 来自专栏深蓝居

    如何在本地测试Fabric Code

    一、单元测试 单元测试是通过testenv这个镜像来完成的,而这个镜像的容器在启动后实际执行的就是unit-test文件夹下面的run.sh脚本。 我们使用make unit-test命令即可对整个Fabric的所有单元测试进行运行。

    1.2K20编辑于 2022-06-16
  • 来自专栏Corley的开发笔记

    uni-app入门教程(1)uni-app简介、部署和目录结构

    可以从NPM依赖中导入资源,如下: <style src="todomvc-app-css/index.css"> 在自定义块上同样支持src导入,如下: <unit-test src=". /unit-test.js"> </unit-test> 文档规范接近Vue单文件组件(SFC)规范,同一个界面由3个语言块完成,具体可参考https://vue-loader.vuejs.org/zh

    7.6K40发布于 2020-12-16
  • 来自专栏一日一工具

    从零打造自己的CI/CD系统|php项目部署v3版本

    directory create•git clone•compile•deploy(upload)•pre-commit(非必须放在这里做,理论上入仓库之前就需要做)•code-style check•unit-test

    74830发布于 2020-07-03
领券