Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for GitLab
  • Getting started
    • All tutorials
    • Deploying GitLab Runner on a Yandex Compute Cloud virtual machine
    • Secure storage of GitLab CI passwords as Yandex Lockbox secrets
    • Continuous deployment of containerized Managed Service for Kubernetes applications
    • Scanning Container Registry for vulnerabilities during continuous deployment of Managed Service for Kubernetes applications
    • Building a CI/CD pipeline with serverless products
    • Storing Docker images in Yandex Container Registry
    • App testing with GitLab
    • Creating test VMs via GitLab CI
    • Integration with Yandex Tracker
    • Invoking a load test from GitLab CI
    • Integration with Argo CD
    • Managing the MLOps lifecycle with ML Registry
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Get your cloud ready
  • Required paid resources
  • Create a GitLab VM
  • Configure GitLab
  • Set the privacy settings
  • Create a project
  • Set up and run testing for the project
  • Configure and register a runner
  • Create a test pipeline
  • Create an error in the project
  • How to delete the resources you created
  1. Tutorials
  2. App testing with GitLab

App testing with GitLab

Written by
Yandex Cloud
Updated at May 6, 2026
  • Get your cloud ready
    • Required paid resources
  • Create a GitLab VM
  • Configure GitLab
    • Set the privacy settings
  • Create a project
  • Set up and run testing for the project
    • Configure and register a runner
    • Create a test pipeline
    • Create an error in the project
  • How to delete the resources you created

GitLab is a web-based Git repository management platform. GitLab also allows developers to run a continuous process for writing, testing, and deploying code.

In this scenario, you will set up GitLab on a virtual machine, create a simple C++ project, set up a test scenario, and test its execution.

To create and test a project in the GitLab environment:

  1. Get your cloud ready.
  2. Required paid resources.
  3. Create a GitLab VM.
  4. Configure GitLab.
  5. Set the privacy settings.
  6. Create a project.
  7. Set up and run testing for the project.
  8. Configure and register a runner.
  9. Create a test pipeline.
  10. Create an error in the project.
  11. How to delete the resources you created.

Get your cloud readyGet your cloud ready

Sign up for Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or create a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can create or select a folder for your infrastructure on the cloud page.

Learn more about clouds and folders here.

Required paid resourcesRequired paid resources

The cost for maintaining a GitLab server includes:

  • Fee for a disk and a continuously running VM (see Yandex Compute Cloud pricing).
  • Fee for a dynamic or static public IP address (see Yandex Virtual Private Cloud pricing).

Create a GitLab VMCreate a GitLab VM

  1. On the folder dashboard in the management console, click Create resource and select Virtual machine instance.

  2. Under Boot disk image, in the Product search field, enter Gitlab and select a public GitLab image.

  3. Under Location, select an availability zone for your VM. If you are not sure which one to choose, leave the default.

  4. Under Disks and file storages, select the SSD disk type and specify its size: 20 GB.

  5. Under Computing resources, navigate to the Custom tab and specify the platform, number of vCPUs, and amount of RAM:

    • Platform: Intel Ice Lake
    • vCPU: 4
    • Guaranteed vCPU performance: 100%
    • RAM: 8 GB
  6. Under Network settings:

    • In the Subnet field, select the network and subnet to connect your VM to. If the required network or subnet is not there, create it.
    • In the Public IP address field, keep Auto to assign the VM a random external IP address from the Yandex Cloud pool or select a static address from the list if you reserved one in advance.
  7. Under Access, select SSH key and specify the VM access credentials:

    • In the Login field, enter the username. Do not use root or other OS-reserved usernames. For operations requiring root privileges, use the sudo command.
    • In the SSH key field, select the SSH key saved in your organization user profile.

      If there are no SSH keys in your profile or you want to add a new key:

      1. Click Add key.

      2. Enter a name for the SSH key.

      3. Select one of the following:

        • Enter manually: Paste the contents of the public SSH key. You need to create an SSH key pair on your own.

        • Load from file: Upload the public part of the SSH key. You need to create an SSH key pair on your own.

        • Generate key: Automatically create an SSH key pair.

          When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the /home/<user_name>/.ssh directory. In Windows, unpack the archive to the C:\Users\<user_name>/.ssh directory. You do not need additionally enter the public key in the management console.

      4. Click Add.

      The system will add the SSH key to your organization user profile. If the organization has disabled the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.

  8. Under General information, specify the VM name: gitlab.

  9. Click Create VM.

Wait about five minutes until the VM is created and all its services are up and running. After all of the services are up and running, GitLab becomes accessible via the web interface in a browser.

Configure GitLabConfigure GitLab

  1. On the Compute Cloud page, select the gitlab VM you created and copy its public IP address.

  2. Connect to the VM over SSH.

  3. Get the GitLab administrator password with the following VM command:

    sudo cat /etc/gitlab/initial_root_password
    
  4. Copy the password without spaces from the Password line to the clipboard or a separate file.

  5. In your browser, open http://<VM_public_IP_address>. This will take you to the GitLab web UI.

  6. Log in as the administrator:

    • Username or email: root.
    • Password: Password you copied in the previous step.

    If you are unable to log in, reset the administrator password.

  7. Change the administrator password.

  8. Log in as the administrator with the new password.

Set the privacy settingsSet the privacy settings

Disable sign-up for other users on the login page:

  1. Go to Admin area.
  2. In the left-hand panel, go to Settings and select the General tab.
  3. Under Sign-up restrictions, click Expand.
  4. Uncheck Sign-up enabled.
  5. Click Save changes.

Now, only the administrator can create new users in the Users tab under Overview.

Create a projectCreate a project

To create a project:

  1. On the GitLab home page, select Create a project.

  2. On the page that opens, specify:

    • Project name: My Project.
    • Project group and project ID: root and my-project, respectively.
    • Description and scope of the project, if required.
  3. Click Create project.

    Creating a project

  4. Once you create the project, go to Settings in the left-hand panel and select the CI/CD tab.

  5. Under Auto DevOps, click Expand, disable Default to Auto DevOps pipeline, and click Save changes.

    Disabling Auto DevOps

  6. Add a project file.

    1. In the left-hand panel, go to the GitLab project.

    2. Click in the repository navigation bar and select New file from the drop-down menu.

    3. Name your file test.cpp. Add program code that checks that 2 multiplied by 2 equals 4 and prints Hello World if the result is 4:

      #include <iostream>
      #include <cassert>
      
      int main() {
        assert(2 * 2 == 4);
        std::cout << "Hello world!" << std::endl;
        return 0;
      }
      

      Adding a file

    4. Enter a commit name in the Commit message field.

    5. Click Commit changes.

Set up and run testing for the projectSet up and run testing for the project

A runner is a program that tests and builds projects in the GitLab environment by following provided instructions.

Configure and register a runnerConfigure and register a runner

  1. Use SSH to connect to the VM and switch to administrator mode in the console:

    sudo -i
    
  2. Download a runner:

    curl --location --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
    
  3. Make the runner executable:

    chmod +x /usr/local/bin/gitlab-runner
    
  4. Create a separate user to start the runner:

    useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
    
  5. Install and start the runner:

    gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
    gitlab-runner start
    
  6. Register your runner in GitLab:

    1. Run the gitlab-runner register command for interactive registration.

    2. Enter your GitLab server address. When you see this prompt:

      Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com)
      

      enter http://<public_IP_address_of_your_VM>.

    3. Enter the registration token for the runner. To get it, go to the project page in GitLab, select Settings in the left-hand panel, and open the CI/CD tab. Then click Expand under Runners. Under Set up a specific Runner manually, copy the token from Step 3 and enter it when prompted as follows:

      Please enter the gitlab-ci token for this runner
      <token>
      

      Getting a token

    4. When you see this prompt:

      Please enter the gitlab-ci description for this runner
      

      enter a description for the runner: My runner.

    5. Leave the tag field empty and pressEnter. Otherwise, by default, the runner will not run jobs unless the project has matching tags.

    6. Specify the runtime. In our scenario, when prompted:

      Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
      

      enter: shell.

The runner is now installed and configured. If everything is set up correctly, you should see the Runners activated for this project section on the page where you copied the registration token, displaying the registered runner.

Successful setup

Create a test pipelineCreate a test pipeline

Create a test pipeline for the runner to complete. Describe the pipeline in a dedicated file named .gitlab-ci.yml located in the project root directory. According to the pipeline, the runner will compile the project source file, convert it to an executable file, and then run it.

As testing will take place in the VM operating system, you need to install the apps required for testing: git to clone the project from the repository and g++ to compile the project.

To create a test pipeline:

  1. Connect to the VM over SSH and install the required apps:

    sudo apt update
    sudo apt install -y git g++
    
  2. Add a test pipeline:

    1. Open the GitLab web UI.

    2. Open the GitLab project.

    3. On the page that opens, click Set up CI/CD.

    4. You will see a page prompting you to add a new file named .gitlab-ci.yml, where you need to describe the pipeline in YAML format. Add the pipeline configuration:

      stages:
        - build
        - test
        - pack
      
      cache:
        paths:
          - hello
      
      build:
        stage: build
        script: g++ test.cpp -o hello
      
      test:
        stage: test
        script: ./hello
      
      pack:
        stage: pack
        script: gzip -c hello > hello.gz
        artifacts:
          paths:
            - hello.gz
      

      The pipeline includes three stages that run one after another:

      • build: First stage that compiles the project into the hello executable.
      • test: Second stage that runs the executable.
      • pack: Third stage that creates an archive with the executable, which you can download via the GitLab web UI after the pipeline completes successfully. The artifacts section lists the files available for download.

      Under cache, specify the files and directories to transfer between stages. If you skip it, the hello file will not be available at the test stage, resulting in an error.

      Test pipeline

    5. Click Commit changes.

After committing, the system will automatically start testing the latest commit. To check its results, select Build on the left-hand panel in the GitLab project, and then Pipelines from the drop-down menu. You should see a line with the first test showing passed. By clicking the cloud icon, you can download the build artifacts.

Create an error in the projectCreate an error in the project

Now modify the project so it produces an error that the runner can detect during testing. Proceed as follows:

  1. Go to the project repository and open the test.cpp file.

  2. Click Edit.

  3. Update the assert so that 2 multiplied by 2 equals 5. This will cause the program to fail.

    ...
    assert(2 * 2 == 5);
    ...
    
  4. Name your commit: Wrong assert in test.cpp.

  5. Click Commit changes.

Open Build → Pipelines. In the Stages column, you can see that the first stage, build, completed successfully, while the second stage, test, returned an error. The third stage, pack, was skipped and the build artifacts were not generated.

If you click the failed progress status and go to Failed Jobs, you can see the error text saying that assert failed:

Runtime error

How to delete the resources you createdHow to delete the resources you created

To stop paying for your deployed server, delete the gitlab VM you created.

If you reserved a static public IP address for this VM:

  1. Select Virtual Private Cloud in your folder.
  2. Navigate to the Public IP addresses tab.
  3. Find the IP address, click , and select Delete.

Was the article helpful?

Previous
Storing Docker images in Yandex Container Registry
Next
Creating test VMs via GitLab CI
© 2026 Direct Cursus Technology L.L.C.