2019-09-17 10:16:34 -04:00
|
|
|
.only-code-memory-job-base:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-06-02 08:08:33 -04:00
|
|
|
- .rails-cache
|
2019-08-26 16:41:55 -04:00
|
|
|
- .default-before_script
|
2020-02-18 10:08:51 -05:00
|
|
|
- .memory:rules
|
2021-10-12 17:09:47 -04:00
|
|
|
variables:
|
|
|
|
METRICS_FILE: "metrics.txt"
|
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
metrics: "${METRICS_FILE}"
|
2022-02-28 13:14:03 -05:00
|
|
|
expire_in: 62d
|
2019-09-17 10:16:34 -04:00
|
|
|
|
2019-06-25 08:11:06 -04:00
|
|
|
|
|
|
|
# Show memory usage caused by invoking require per gem.
|
2022-02-01 10:18:50 -05:00
|
|
|
# Hits the app with one request to ensure that any last minute require-s have been called.
|
2019-06-25 08:11:06 -04:00
|
|
|
# The application is booted in `production` environment.
|
|
|
|
# All tests are run without a webserver (directly using Rack::Mock by default).
|
|
|
|
memory-on-boot:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
2019-09-17 10:16:34 -04:00
|
|
|
- .only-code-memory-job-base
|
2021-05-10 08:10:26 -04:00
|
|
|
- .use-pg12
|
2020-02-20 13:08:51 -05:00
|
|
|
stage: test
|
2020-06-02 08:08:33 -04:00
|
|
|
needs: ["setup-test-env", "compile-test-assets"]
|
2019-06-25 08:11:06 -04:00
|
|
|
variables:
|
|
|
|
NODE_ENV: "production"
|
|
|
|
RAILS_ENV: "production"
|
|
|
|
SETUP_DB: "true"
|
2022-02-28 13:14:03 -05:00
|
|
|
MEMORY_ON_BOOT_FILE_PREFIX: "tmp/memory_on_boot_"
|
|
|
|
TEST_COUNT: 5
|
2019-06-25 08:11:06 -04:00
|
|
|
script:
|
2022-02-28 13:14:03 -05:00
|
|
|
- |
|
|
|
|
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}"
|
2019-06-25 08:11:06 -04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-10-12 17:09:47 -04:00
|
|
|
- "${METRICS_FILE}"
|
2022-02-28 13:14:03 -05:00
|
|
|
- "${MEMORY_ON_BOOT_FILE_PREFIX}*.txt"
|