exercism-config 0.134.0 → 0.137.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +3 -22
- data/README.md +1 -1
- data/lib/exercism.rb +17 -6
- data/lib/exercism_config/version.rb +1 -1
- data/settings/ci.yml +1 -0
- data/settings/local.yml +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 22429a8fffb91a65c663677ff44a9346a02fd10b9396ee13cc637428d31ff214
|
|
4
|
+
data.tar.gz: b07696c135929e83a86b032716f97ca51308954f0597b163d698d5407f7768cf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21352c52dcd6d978cfba2740b42ef420bc80bf78e2089918b965ff75a84b4823c1c1dff8e154e4372ca4d3a39c168b74549f399ff3949d6dd5e12d8b8ec36771
|
|
7
|
+
data.tar.gz: e475a59e3ff1adc82fa6535f9219d92baf96edca1e7802b43ccb94326c5ee64ef848bcc79a615a47e85402a0ccc6bedfd396baa1f8aa83f162a02391c8eafcd4
|
data/.github/workflows/tests.yml
CHANGED
|
@@ -12,7 +12,8 @@ jobs:
|
|
|
12
12
|
|
|
13
13
|
services:
|
|
14
14
|
aws:
|
|
15
|
-
|
|
15
|
+
# Pinned to match the website. Later images need a LocalStack licence.
|
|
16
|
+
image: "localstack/localstack:2.3.2"
|
|
16
17
|
ports:
|
|
17
18
|
- 4566
|
|
18
19
|
|
|
@@ -50,14 +51,6 @@ jobs:
|
|
|
50
51
|
bundle exec setup_exercism_config
|
|
51
52
|
bundle exec setup_exercism_local_aws
|
|
52
53
|
|
|
53
|
-
###
|
|
54
|
-
# Setup code climate
|
|
55
|
-
- name: Setup Code Climate test-reporter
|
|
56
|
-
run: |
|
|
57
|
-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
58
|
-
chmod +x ./cc-test-reporter
|
|
59
|
-
./cc-test-reporter before-build
|
|
60
|
-
|
|
61
54
|
###
|
|
62
55
|
# Run the tests
|
|
63
56
|
- name: Run Ruby tests
|
|
@@ -66,16 +59,4 @@ jobs:
|
|
|
66
59
|
EXERCISM_CI: true
|
|
67
60
|
AWS_PORT: ${{ job.services.aws.ports['4566'] }}
|
|
68
61
|
CAPTURE_CODE_COVERAGE: true
|
|
69
|
-
run:
|
|
70
|
-
bundle exec rake test
|
|
71
|
-
./cc-test-reporter format-coverage -t simplecov -o codeclimate.backend.json coverage/backend/.resultset.json
|
|
72
|
-
|
|
73
|
-
###
|
|
74
|
-
# Publish the coverage to CodeClimate
|
|
75
|
-
- name: Publish code coverage
|
|
76
|
-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
77
|
-
env:
|
|
78
|
-
GIT_BRANCH: ${GITHUB_REF/refs\/heads\//}
|
|
79
|
-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|
|
80
|
-
run: |
|
|
81
|
-
./cc-test-reporter upload-coverage -i codeclimate.*.json
|
|
62
|
+
run: bundle exec rake test
|
data/README.md
CHANGED
|
@@ -103,7 +103,7 @@ We use localstack for this.
|
|
|
103
103
|
To start localstack use the following command:
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
docker run -dp 3042:8080 -p 3040:4566 -p 3041:4566 localstack/localstack
|
|
106
|
+
docker run -dp 3042:8080 -p 3040:4566 -p 3041:4566 localstack/localstack:2.3.2
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
## Usage
|
data/lib/exercism.rb
CHANGED
|
@@ -33,13 +33,24 @@ module Exercism
|
|
|
33
33
|
Aws::DynamoDB::Client.new(ExercismConfig::GenerateAwsSettings.())
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
S3_CLIENT_MUTEX = Mutex.new
|
|
37
|
+
|
|
38
|
+
# Memoized so the SDK's connection pool is reused, with a raised
|
|
39
|
+
# http_idle_timeout (default 5s) so pooled connections survive quiet
|
|
40
|
+
# spells on low-QPS paths instead of paying a TLS handshake each time.
|
|
41
|
+
# The mutex guarantees exactly one client per process.
|
|
36
42
|
def self.s3_client
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
S3_CLIENT_MUTEX.synchronize do
|
|
44
|
+
@s3_client ||= begin
|
|
45
|
+
require 'aws-sdk-s3'
|
|
46
|
+
Aws::S3::Client.new(
|
|
47
|
+
ExercismConfig::GenerateAwsSettings.().merge(
|
|
48
|
+
force_path_style: true,
|
|
49
|
+
http_idle_timeout: 60
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
43
54
|
end
|
|
44
55
|
|
|
45
56
|
def self.ecr_client
|
data/settings/ci.yml
CHANGED
|
@@ -31,6 +31,7 @@ mysql_port: <%= ENV["MYSQL_PORT"] %>
|
|
|
31
31
|
aws_submissions_bucket: exercism-v3-submissions
|
|
32
32
|
aws_tooling_jobs_bucket: exercism-v3-tooling-jobs
|
|
33
33
|
aws_cache_bucket: exercism-cache
|
|
34
|
+
aws_icons_bucket: exercism-v3-icons
|
|
34
35
|
|
|
35
36
|
# Hosts
|
|
36
37
|
website_icons_host: https://assets.exercism.org
|
data/settings/local.yml
CHANGED