Welcome to mirror list, hosted at ThFree Co, Russian Federation.

memory.gitlab-ci.yml « ci « .gitlab - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: efdae0715aae678ba5557465930af28f4e701134 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.only-code-memory-job-base:
  extends:
    - .default-retry
    - .rails-cache
    - .default-before_script
    - .memory:rules
  variables:
    METRICS_FILE: "metrics.txt"
  artifacts:
    reports:
      metrics: "${METRICS_FILE}"
    expire_in: 62d


# Show memory usage caused by invoking require per gem.
# Hits the app with one request to ensure that any last minute require-s have been called.
# The application is booted in `production` environment.
# All tests are run without a webserver (directly using Rack::Mock by default).
memory-on-boot:
  extends:
    - .only-code-memory-job-base
    - .use-pg12
  stage: test
  needs: ["setup-test-env", "compile-test-assets"]
  variables:
    NODE_ENV: "production"
    RAILS_ENV: "production"
    SETUP_DB: "true"
    MEMORY_ON_BOOT_FILE_PREFIX: "tmp/memory_on_boot_"
    TEST_COUNT: 5
  script:
    - |
      for i in $(seq 1 $TEST_COUNT)
      do
        echo "Starting run $i out of $TEST_COUNT"
        PATH_TO_HIT="/users/sign_in" CUT_OFF=0.3 bundle exec derailed exec perf:mem >> "${MEMORY_ON_BOOT_FILE_PREFIX}$i.txt"
      done
    - scripts/generate-memory-metrics-on-boot "${MEMORY_ON_BOOT_FILE_PREFIX}" "$TEST_COUNT" >> "${METRICS_FILE}"
  artifacts:
    paths:
      - "${METRICS_FILE}"
      - "${MEMORY_ON_BOOT_FILE_PREFIX}*.txt"