#Continuous Integration

0 Followers · 68 Posts

In software engineering, continuous integration (CI) is the practice of merging all developer working copies to a shared mainline several times a day.

Article Timothy Leavitt · Aug 27, 2020 7m read

Introduction

In a previous article, I discussed patterns for running unit tests via the  InterSystems Package Manager. This article goes a step further, using GitHub actions to drive test execution and reporting. The motivating use case is running CI for one of my Open Exchange projects, AppS.REST (see the introductory article for it here). You can see the full implementation from which the snippets in this article were taken on GitHub; it could easily serve as a template for running CI for other projects using the ObjectScript package manager.

Features demonstrated implementation include:

0
2 929
Article Janne Korhonen · Jun 4, 2020 5m read

A lot of developers like to work with Studio and have been looking into source code version control such as GIT or into enabling modern development workflows like CICD or DevOps processes.

This article describe an elementary solution to get you started in CICD and DevOps, even if you are not yet ready to move to Atelier or forth coming VS Code approach which enable client side source code version control.

Step 1: Setting up version control with Studio and GIT

0
0 1038
Announcement Rubens Silva · Mar 16, 2020

Hello all!

As we ObjectScript developers have been experiencing, preparing an environment to run CI related tasks can be quite the chore. This is why I have been thinking about how we could improve this workflow and the result of that effort is IRIS-CI.

See how it works here.

Quickstart

1.Download the image from the Docker Hub registry:

docker pull rfns/iris-ci:0.5.3
  1. Run the container (with the default settings):
docker run --rm --name ci -t -v /path/to/your/app:/opt/ci/app rfns/iris-ci:0.5.3

Notice that volume mounting to /path/to/your/app? This is where the app should be. And that's it: the only thing required to start running the test suites is the path of the application.

Also, since this is supposed to be a ephemeral and run-once container, there's no need to keep it listed after executing it, that's why there's the --rm flag.

TL;DR;

If you want an example on how to how use it:

Check the usage with my another project dotenv.

Advanced setup

Some projects might need sophisticated setups in order to run the test suites, for such circunstances there's two customization levels:

  1. Environment variables
  2. Volume overwrite

Environment variables

Environment variables are the most simple customization format and should suffice for most situations.

There's two ways to provide an environment variable:

  • -e VAR_NAME="var value" while using docker run.
  • By providing a .env file by mounting an extra volume for docker run like this: -v /my/app/.env:/opt/ci/.env.

NOTE: In case a variable is defined in both formats, using the -e format takes precedence over using a .env file.

Types of environment variables

  • Variables prefixed with CI_{NAME} are passed down as name to the installer manifest.
  • Variables prefixed with TESPARAM_{NAME}are passed down as NAME to the unit test manager's UserFields property.
  • TEST_SUITEand TEST_CASE to control where to locate and which test case to target.

Every variable is available to read from the configuration.Envs list, which is passeddown through Run and OnAfterRun class methods.

If TEST_CASE is not specified then the recursive flag will be set.

In a project with many classes it might be interesting to at least define the TEST_SUITE and reduce the search scope due to performance concerns.

Volume overwrite

This image ships with a default installer that's focused on running test suites. But it's possbile to overwrite the following files in order to make it execute different tasks like: generating a XML file for old Caché versions.

  • /opt/ci/App/Installer.cls
  • /opt/ci/Runner.cls

For more details on how to implement them, please check the default implementations:

Installer.clsRunner.cls

TIP: Before overwriting the default Installer.cls check if you really need to, because the current implementation also allows to create configurated web applications.

EDIT: Link added.

0
1 418
Question Javier Sanchis · Feb 13, 2020

Hi, everybody, 

I've been reading some posts in the community but I haven't been able to come to a conclusion. Here's my point.

I have a cache code, and following this guide https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?… but I can't understand how to run this from jenkins for example, without using the console, and thus automate the process. That is to say, if it were possible to do it, what steps should I follow.

Thank you very much

2
0 1141
Question Ankita JAin · May 31, 2017

Hi ,

I am stuck with unit  test failure with intersystem . In case of unit test failure, the build in jenkins is succeding while the build in jenkins should fail in case unit test failure .

In cache programming i am using %UnitTest.Manager class and DebugRunTestCase method within it. I'm able to link studio with jenkins. I wanna fail my build in jenkins, if any of the test cases fails. Could anyone help?

14
0 1824
Article Ben Spead · Sep 12, 2017 1m read

The Widgets Direct sample application highlights many aspects of how to use InterSystems technologies to build a modern web application.  Features include:

  • Angular Material + AngularJS + JSON + REST based interactive application with Step by Step instructions on how it was built
  • Example scripts for server-side source control configuration with Perforce
  • %UnitTest logic for automated regression testing
  • %Installer class for automated instance installation from source control 
  • Scripts for Continuous Integration (CI) with Jenkins
  • Docker Manifest for automated provisioning of an instance
5
0 1543
InterSystems Official Thomas Carroll · Apr 5, 2019

Hi Community!

We're pleased to announce that that InterSystems IRIS Community Edition is available on the Docker Store! InterSystems IRIS Community Edition is the no-cost developer edition designed to lower the barriers to entry to get started with IRIS. Now that it is listed on the Docker Store, running an IRIS Community instance is as easy as -

docker run -d -p 52773:52773 store/intersystems/iris:2019.1.0.511.0-community

For more on running IRIS in containers check out our Documentation or one of the many Community posts on the topic!

14
2 3860
Article Dmitry Maslennikov · Mar 20, 2019 3m read

This is a continuation of my story about the development of my project isc-tar started in the first part.

Just having tests is not enough, it does not mean that you will run tests after all changes. Running tests should be automated, and when you cover all your functionality with tests, everything should work well after any change in any place.  And Continuous Integration (CI) helps to keep the code and deployment procedure with as fewer bugs as possible and automates the routine procedures, like publishing releases.

I use GitHub to store the source code. And some time ago GitHub started to work on its own CI/CD platform and named it GitHub Actions. It is not widely available, yet. You have to be signed as a beta tester for this feature, as I did. GitHub Actions uses quite a different way how to deal with a build workflow. What is important that Github Actions allows to use Docker, and it’s quite easy to customize available actions. And interesting that GitHub Actions is really much bigger than any classic CI like we have in Travis, Circle or Gitlab CI and so on. You can find more in the official documentation.

0
1 757
Article Eduard Lebedyuk · Mar 7, 2018 7m read

In this series of articles, I'd like to present and discuss several possible approaches toward software development with InterSystems technologies and GitLab. I will cover such topics as:

  • Git 101
  • Git flow (development process)
  • GitLab installation
  • GitLab Workflow
  • Continuous Delivery
  • GitLab installation and configuration
  • GitLab CI/CD

In the previous article, we covered Git basics, why a high-level understanding of Git concepts is important for modern software development, and how Git can be used to develop software. Still, our focus was on the implementation part of software development, but this part presents:

  • GitLab Workflow - a complete software life cycle process - from idea to user feedback
  • Continuous Delivery - software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time. It aims at building, testing, and releasing software faster and more frequently.
1
3 3394
Question Thiago Zenaro · Oct 30, 2018

Hi community.

I'm trying to create a "setup" method to be called on a batch script but i'm getting the error <INVALID ARGUMENT> when I pass a string as an argument to this method.

The idea is to call the method with a folder as the parameter, for example:

##class(test.MyClass).MyMethod("D:\path\to\my\file.json")
 

My class (just for example)

Class test.MyClass

{
ClassMethod MyMethod(pFilePath)
{
Write pFilePath ,!
}
}

I'm using cmd as follows:

D:\>csession CACHE20172 -U %SYS ##class(test.MyClass).MyMethod(100)
100

If I use a number, It works, but any string value I get the error

7
0 1176
Question Brian Chen · Jan 27, 2019

Hello,

I am trying to copy an xml file generated on an Apache server into the Jenkins workspace post-build. I was thinking to use a 'send files over ssh' post-build script, but have not done this before and do not know how to refer to the file location on Apache server vs on Jenkins.

For example, if I want to copy from Apache's location of: "classes/UnitTest/Results.xml" into Jenkin's workspace: "/ReportFiles/Results.xml",

How does the script differentiate between whether the location address refers to the Apache server or Jenkins workspace?

Or is there a better alternative way to do this?
 

2
0 21670
Article Eduard Lebedyuk · Mar 1, 2018 6m read

Everybody has a testing environment.

Some people are lucky enough to have a totally separate environment to run production in.

-- Unknown

.

In this series of articles, I'd like to present and discuss several possible approaches toward software development with InterSystems technologies and GitLab. I will cover such topics as:

  • Git 101
  • Git flow (development process)
  • GitLab installation
  • GitLab WorkFlow
  • GitLab CI/CD
  • CI/CD with containers

This first part deals with the cornerstone of modern software development - Git version control system and various Git flows.

1
4 4880
Announcement Luca Ravazzolo · Aug 21, 2018

Hi All,

Who, in the age of digital transformation, doesn't want to reap more benefits out of any process, procedure, and resource we have? At InterSystems Solution Developers Conference (part of InterSystems Global Summit 2018) we will have sessions on how to improve the way applications are built with modern tools like Docker containers, Gitlab, Circle CI, Travis, etc., how continuous integration and continuous delivery (CI/CD) processes can help us deliver more value quickly to the end-user, and how we can start thinking about modernizing traditional applications.

0
1 459
Announcement Evgeny Shvarov · Apr 11, 2018

Hi, Community!

Continuous Delivery is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time. It aims at building, testing, and releasing software faster and more frequently. The approach helps reduce the cost, time, and risk of delivering changes by allowing for more incremental updates to applications in production.

Join us at 07:00 UTC, April 24th for a webinar with a live demo "Git flows and Continuous Delivery" by @Eduard Lebedyuk 

The language of the webinar is Russian.

Also, see the related articles on DC.

1
0 548
Article Eduard Lebedyuk · Jul 6, 2018 9m read

In this series of articles, I'd like to present and discuss several possible approaches toward software development with InterSystems technologies and GitLab. I will cover such topics as:

  • Git 101
  • Git flow (development process)
  • GitLab installation
  • GitLab Workflow
  • Continuous Delivery
  • GitLab installation and configuration
  • GitLab CI/CD
  • Why containers?
  • Containers infrastructure
  • CD using containers
  • CD using ICM

In this article, we'll build Continuous Delivery with InterSystems Cloud Manager. ICM is a cloud provisioning and deployment solution for applications based on InterSystems IRIS. It allows you to define the desired deployment configuration and ICM would provision it automatically. For more information take a look at First Look: ICM.

0
2 1403
Article Eduard Lebedyuk · Apr 6, 2018 5m read

In this series of articles, I'd like to present and discuss several possible approaches toward software development with InterSystems technologies and GitLab. I will cover such topics as:

  • Git 101
  • Git flow (development process)
  • GitLab installation
  • GitLab Workflow
  • Continuous Delivery
  • GitLab installation and configuration
  • GitLab CI/CD
  • Why containers?
  • Containers infrastructure
  • GitLab CI/CD using containers

In the first article, we covered Git basics, why a high-level understanding of Git concepts is important for modern software development, and how Git can be used to develop software.

In the second article, we covered GitLab Workflow - a complete software life cycle process and Continuous Delivery.

In the third article, we covered GitLab installation and configuration and connecting your environments to GitLab

In the fourth article, we wrote a CD configuration.

In the fifth article, we talked about containers and how (and why) they can be used.

In this article let's discuss main components you'll need to run a continuous delivery pipeline with containers and how they all work together.

0
2 3887
Article Eduard Lebedyuk · Mar 26, 2018 5m read

In this series of articles, I'd like to present and discuss several possible approaches toward software development with InterSystems technologies and GitLab. I will cover such topics as:

  • Git 101
  • Git flow (development process)
  • GitLab installation
  • GitLab Workflow
  • Continuous Delivery
  • GitLab installation and configuration
  • GitLab CI/CD
  • Why containers?
  • GitLab CI/CD using containers

In the first article, we covered Git basics, why a high-level understanding of Git concepts is important for modern software development, and how Git can be used to develop software.

In the second article, we covered GitLab Workflow - a complete software life cycle process and Continuous Delivery.

In the third article,  we covered GitLab installation and configuration and connecting your environments to GitLab

In the fourth article, we wrote a CD configuration.

In this article, let's talk about containers and how (and why) they can be used.

0
1 1471
Question Chris Fine · Mar 8, 2018

hi, new here, and new to cache and deepsee.

i've been trying to setup a copy of our production server so we can use it for testing/development.

i did a full  backup. moved it to the new server.  ran the DBREST command.  got it to restore but seems like permissions get all messed up. and it just generates a bunch of errors.

is there an easier/better way of doing this?

13
0 689
Question Eduard Lebedyuk · Feb 19, 2018

Let's say I want to execute  this cache script (saved as test.txt) from OS terminal:

zn "USER"
write 1
zn "%SYS"
write 2
halt

Executing the following command in a terminal:

csession cache < test.txt

Would yield this output:

$ csession cache < script.txt

Node: gitlab-test, Instance: CACHE

USER>

USER>
1
USER>

%SYS>
2
%SYS>
Job succeeded

Is there a better way to run these scripts?

Currently I have two problems:

  1. I have several variables defined in my bash script, what's the best approach to pass them into Caché? 
  2. I can't capture script input (for example write 1)
1
0 1139
Question Ankita JAin · May 31, 2017

Is there any methods/ways through which will get to know whether any of the Unit Test cases is/are failing in the Terminal with status as either 0 or False in case of Failure & 1 or Ture in case of Test Passes (we are getting an url of the csp page with the report which has the passed failed status) as we need to send this failure status to Jenkins for the Build to Fail (where in we have acheived this part in making the build failure/success based on  harcoded boolean)

2
0 753