Cache certificate files in specs
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from gitlab-ce!31169 should be addressed:
-
@hfyngvason started a discussion: As I'm also sad to see the extra performance gains vanish, would caching these win you back the last bits of performance? We could read them into constants as so
SAMPLE_KEY = File.read(Rails.root.join('spec/fixtures/clusters/sample_key.key') SAMPLE_CERT = File.read(Rails.root.join('spec/fixtures/clusters/sample_cert.pem')or maybe extend e.g. FixtureHelpers with something like
def memoized_fixture_file(*args) FixtureHelpers.fixture_cache[*args] ||= fixture_file(*args) end def self.fixture_cache @fixture_cache ||= {} end
Edited by 🤖 GitLab Bot 🤖