Runner

Gitlab-CI 手动搭建、实战体验

℡╲_俬逩灬. 提交于 2020-01-06 14:00:50
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 开源代码托管平台 Gitlab ,从10.0版本开始内置了 CI 功能,开始向 Jenkins看齐。 那么看过了那么多 Gitlab 相关的文章,是时候动手体验它了。 好,咱们从零开始、探其本质之旅…… 概述 本篇文章介绍使用Docker快速搭建Gitlab环境,用于安全的学习它的功能。 最大的特点是:快速搭建、最少资源。若在生产上使用,需要更多考虑 可维护性、高可用、数据安全 等因素。 环境 # uname -a Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux # cat /etc/docker/daemon.json # 使用国内DaoCloud加速Docker镜像下载的加速 {"registry-mirrors": ["http://f1361db2.m.daocloud.io"]} # docker info Containers: 3 Running: 3 Paused: 0 Stopped: 0 Images: 10 Server Version: 18.06.3-ce Storage Driver: aufs Root Dir: /mnt/docker/aufs

Why does Visual Studio 2015 console runner not recognize MSpecs?

孤者浪人 提交于 2019-12-23 15:14:46
问题 I've written some MSpecs, but Visual Studio (2015) test runner does not recognize them. I've added the Machine.Specifications.Runner.Console and all required Machine.Specification -packages using the NuGet-PM. But when I choose Test->Run Test , the mspec-containing file is not even listed. Beyond is an example of the mspecs I wrote so far, which is located in an own project/solution that contains some other (regular unit) test, which all run fine btw. [Subject(typeOf(ControllerForm)] public

Sonarqube authorization - how to authorize with sonar-maven-plugin when sonar.forceAuthentication is enabled

与世无争的帅哥 提交于 2019-12-21 12:01:06
问题 I've got sonarqube 6.5 with default configs. When sonar.forceAuthentication flag is set to false, I can create and analyse project through command given below. mvn sonar:sonar -Dsonar.host.url=https://mySonarHost/sonar -Dsonar.login=mySonarUserKey When I enable sonar.forceAuthentication parameter (sonar.forceAuthentication=true), I can't analyse project. I always get maven error: [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on

docker-gitlab-runner

久未见 提交于 2019-12-18 20:06:31
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 拉取镜像 docker pull gitlab/gitlab-runner:latest 生成容器 docker run -d \ --name gitlab-runner \ --restart always \ -v /gitlab-runner/config:/etc/gitlab-runner \ -v /var/run/docker.sock:/var/run/docker.sock \ gitlab/gitlab-runner:latest 进入容器 docker exec -it gitlab-runner /bin/bash 注册runner,并按如下提示输入: gitlab-runner register > Please enter the gitlab-ci coordinator URL https://code.weflys.com > Please enter the gitlab-ci token for this runner in1dadgmRQMyso-C9bzW > Please enter the gitlab-ci description for this runner gitlab-runner > Please enter the gitlab-ci tags

python接口自动化(二十一)--unittest简介(详解)

◇◆丶佛笑我妖孽 提交于 2019-12-17 14:45:57
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 简介   前边的随笔主要介绍的requests模块的有关知识个内容,接下来看一下python的单元测试框架unittest。熟悉 或者了解java 的小伙伴应该都清楚常见的单元测试框架 Junit 和 TestNG,这个招聘的需求上也是经常见到的。python 里面也有单元 测试框架-unittest,相当于是一个 python 版的 junit。python 里面的单元测试框架除了 unittest,还有一个 pytest 框架,这个实际上用的比较少,后面有空再继续介绍和分享。unittest单元测试框架不仅可以适用于单元测试,还可以适用WEB自动化测 试用例的开发与执行,该测试框架可组织执行测试用例,并且提供了丰富的断言方法,判断测试用例是否通过,最终生成测试结果。 Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's Smalltalk testing framework. 翻译:python 的单元测试框架,是基于 java 的 junit 测试框架 简单的用法 1、从官网源码或者print的help里查找unittest用法 2、我们将上图的这段代码 copy 出来,单独运行,看看测试和运行结果

How to close testcafe runner

佐手、 提交于 2019-12-10 19:34:05
问题 I'm using Testcafe runner to execute some tests i got. When everything is finished the console remains executing the script forever. Here is my code: createTestCafe('localhost', 1337, 1338) .then(tc => { testcafe = tc; runner = testcafe.createRunner(); return runner .src(['offerRefresh.js']) .browsers(['nightmare']) .screenshots('./screenshots', true) .run(); }) .then(failedCount => { console.log('Tests failed: ' + failedCount); testcafe.close(); }); The console remains like this: Tests

JUnit4单元测试的两种形式

我的梦境 提交于 2019-12-10 09:31:53
特点: JUnit 是一个开放的资源框架,用于编写和运行测试。 提供注释来识别测试方法。 提供断言来测试预期结果。 提供测试运行来运行测试。 JUnit 测试允许你编写代码更快,并能提高质量。 JUnit 优雅简洁。没那么复杂,花费时间较少。 JUnit 测试可以自动运行并且检查自身结果并提供即时反馈。所以也没有必要人工梳理测试结果的报告。 JUnit 测试可以被组织为测试套件,包含测试用例,甚至其他的测试套件。 JUnit 在一个条中显示进度。如果运行良好则是绿色;如果运行失败,则变成红色。 JUnit测试减少后期维护时间以及成本 导入JUnit4单元测试所需的jar包 打开开发工具 eclipse|myeclipse -> 对应项目右击 > Build Path > Add Library > JUnit > 选择版本JUnit4 > Finish 单元模块测试——单个类 1、使用@Test注解 例子: import static org.junit.Assert.assertEquals; import org.junit.Test; public class Test01 { final static String CH = "中国"; @Test //(命名格式建议用test+方法名) public void testCode() throws Exception {

Turn some print off in python unittest

大憨熊 提交于 2019-12-09 12:01:26
问题 Im using unittest and it prints ".", "E" or "F" for "ok", "error" and "fail" after each test it does. How do I switch it off ? Im using Python 2.7 and these print come from the runner class which is built in. It sounds very tough to override the classes because it's all nested. edit: I only want to take off the characters E . and F because they don't appear at the same time as some other log in my tests. 回答1: The output of unittest is written to the standard error stream, which you can pipe

springBoot启动时,选择可执行的任务

◇◆丶佛笑我妖孽 提交于 2019-12-07 17:03:39
一次。。有人问我:“boot 启动时 如果想要执行一些任务怎么做?” 我特二的回答。放在spring auto 启动配置项里面 然后在spring容器启动的时候注入。或者使用动态代理。做切面。 虽然上述方式貌似可以执行。但有点复杂。其实boot提供了一种启动后就做的任务操作。 CommandLineRunner 看源码说明为: Spring Batch jobs. Runs all jobs in the surrounding context by default. Can also be used to launch a specific job by providing a jobName。 即,在spring容器启动的时候就开始批处理一些任务。是随spring启动而加载运行的。 使用方式:自定义一个model 实现该及接口并重写run 方法 package org.springboot.sample.runner; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; @Component public class MyStartupRunner implements CommandLineRunner { @Override

SpringBoot入坑指南之三:业务初始化

故事扮演 提交于 2019-12-07 17:03:29
概述 在实际项目开发过程中,有时候需要在服务启动时进行一些业务初始化操作,这些操作只需要在服务启动后执行一次,那么通过Spring Boot如何实现该需求呢? Spring Boot提供了ApplicationRunner和CommandLineRunner两种服务接口,这两种服务接口都可以实现上面的业务需求,本文将对这两种服务接口实现进行介绍。 ApplicationRunner与CommandLineRunner 异同点 相同点 两者均在服务启动完成后执行,并且只执行一次。 两者都能获取到应用的命令行参数。 两者触发执行的时间点是一致的。 不同点 虽然两者都是获取到应用的命令行参数,但是ApplicationRunner获取到的是封装后的ApplicationArguments对象,而CommandLine获取到的是ApplicationArguments中的sourceArgs属性(List<String>),即原始参数字符串列表. 执行顺序 很多误认为CommandLineRunner会先于ApplicationRunner执行,但是实际上两者是一起触发执行的,可以阅读SpringApplication.class方法中的源码 1.SpringApplication.class中的run方法,会在执行完一些列初始化工作之后