1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-16 11:09:33 +02:00
sap-jenkins-library/documentation/docs/scenarios/abapEnvironmentTest.md
Daniel Mieg cf69206a58
Docu updates (#2545)
* Docu updates

* Remove empty lines

* Add quotes

* Change to list
2021-01-27 17:18:28 +01:00

6.0 KiB

Continuous Testing on SAP BTP ABAP Environment

Introduction

This scenario describes how to test ABAP development for the SAP BTP ABAP Environment (also known as Steampunk). In Steampunk, the development is done within “software components” (also called: “repositories”) and "transported" via git-based approaches. The ABAP Environment Pipeline is a predefined pipeline, which can be used to import ABAP development into a quality system and execute tests.

!!! caution "Upcoming 2102 release of SAP BTP ABAP Environment" With the upcoming 2102 release of SAP BTP ABAP Environment some changes to the backend behavior of the MANAGE_GIT_REPOSITORY service are introduced. Specifically: - To pull a software component to a system, the software component needs to be cloned first. - It is planned to add the possibility to clone a software component repeatedly with the hotfix collection HFC03 of release 2102 Implications for the “abapEnvironmentPipeline”: If you are using the “Prepare System” stage to create a new ABAP Environment system, it is no longer possible to use the “Clone Repositories” stage with the “Pull” strategy or with the default strategy (no strategy specified). Please use the strategy “Clone” instead. For more information, have a look at the stage documentation. The strategy “AddonBuild” will execute the abapEnvironmentCloneGitRepo instead of the previous logic. No configuration changes should be necessary. Please be aware that a repeated execution of a pipeline using the strategy “Clone” or “AddonBuild” will not be possible until hotfix collection HFC03 (planned). The recommended workaround is to replace the strategy “AddonBuild” with “CheckoutPull”, whenever the system from a previous pipeline run is reused.

Pipeline

For this scenario three stages of the ABAP Environment Pipeline are relevant: "Prepare System", "Clone Repositories" and "ATC".

Prepare System

The pipeline starts with the stage "Prepare System". This stage, however, is optional. If this stage is active, a new Steampunk system is created for each pipeline execution. This has the advantage, that each test runs on a fresh system without a history. On the other hand, the duration of each pipeline execution will increase as the system provisioning takes a significant amount of time. If this stage is not active, you have to provide a prepared Steampunk (quality) system for the other stages. Then, each pipeline execution runs on the same system. Of course, the system has a history, but the pipeline duration will be shorter. Please also consider: the total costs may increase for a static system in contrast to a system, which is only active during the pipeline.

Clone Repositories

This stage is responsible for cloning (or pulling) the defined software components (repositories) to the system.

ATC

This stage runs ATC checks on the SAP BTP ABAP Environment system. The results are returned in the "CheckStyle" format. With the help of a stage extension, a plugin can be used to visualize the check results.

Prerequisites

There are several parts that are required to run the pipeline.

Jenkins Server

The pipeline for testing software components has been created specifically for Jenkins. Therefore, a Jenkins Server is required. The piper project provides a Jenkins image, which already includes the necessary configurations. Of course, it is also possible to configure an existing server.

Git Repository

The pipeline configuration is done in a git repository (for example on GitHub). This repository needs to be accessed by the Jenkins Server. If the repository is password protected, the user and password (or access token) should be stored in the Jenkins Credentials Store (Manage Jenkins → Manage Credentials).

Cloud Foundry Access

ABAP Environment systems are created in the SAP BTP Cockpit. For this pipeline, the creation and deletion of the systems are automated via the Cloud Foundry Command Line Interface: cf CLI. For this to work, two things need to be configured:

  • Cloud Foundry needs to be enabled on subaccount level. This can be done on the Subaccount Overview page. The subaccount is then mapped to a “Cloud Foundry Organization”, for which you must provide a suitable name during the creation. Have a look at the documentation for more details.
  • A (technical) user is required to access the SAP BTP via the cf CLI. The user needs to be a member of the global account and has to have the Space Developer role. The user and password need to be stored in the Jenkins Credentials Store.

During the pipeline configuration, you will specify the Service Plan, which will be used for the creation of an ABAP Environment system. Please make sure, that there are enough entitlements for this Service Plan in the Subaccount.

Configuration

Please refer to the configuration page or have a look at these examples: Running ATC checks on a transient system or running ATC checks on a static system.