specwrk 0.6.0 → 0.6.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf78cf2d1c82bc0878e1e89777eb8de0ab04af441e210c64a15c2bad1277c1fa
4
- data.tar.gz: 3701d6f676e4c31c3fb787f4ca59a8aaa7aa412118371470b069471da4e6c933
3
+ metadata.gz: 7467aa52809672311415ce6338aa0baa26b13cbb4fd4a2bf12854726f500517e
4
+ data.tar.gz: 1226cb23262a885106c39ec68c97d903c410976b12b4e857e739009284b42da2
5
5
  SHA512:
6
- metadata.gz: debda5ab7128ae03e74652196da8783b4d78ddf3648ccfd2c3e62104fe8a3fb87b98abbc68deb7d66565d66474a504a8d778ca0de44eef311e14188a4258f856
7
- data.tar.gz: 1a4089b567a0840f91a133fef5580b6c5bd3c43190eb7cd1156fe3439e042f727b62bdf69ee1624815ac741f738907e43c92559be1f4c4d55268b2db1625b074
6
+ metadata.gz: c5ecdc6493127599390e7a95e13148cef715165c8ec4c3d897fc643eca7895e283dc21cb20f99b2f4d961dec8a4110c6e3ec3d077de0a609da6d2c58ee5a13a4
7
+ data.tar.gz: 39ec42792a73bd68b693b81b379e54bb959fe21a78bfe811f645135e11e28793e5daf23b1f39a6d36fe81b56ae46963b4cdf95df632230adcc09c71460fae92f
@@ -1,11 +1,6 @@
1
1
  FROM ruby:3.4-alpine
2
2
 
3
- RUN apk add --no-cache \
4
- build-base \
5
- ruby-dev \
6
- linux-headers \
7
- zlib-dev \
8
- libffi-dev
3
+ RUN apk add --no-cache build-base
9
4
 
10
5
  WORKDIR /app
11
6
 
@@ -13,14 +8,15 @@ RUN mkdir .specwrk/
13
8
 
14
9
  ARG SPECWRK_SRV_PORT=5138
15
10
  ARG SPECWRK_VERSION=latest
16
- ARG GEMFILE=specwrk-$SPECWRK_VERSION.gem
11
+ ARG GEM_FILE=specwrk-$SPECWRK_VERSION.gem
17
12
 
18
- COPY $GEMFILE ./
19
- RUN gem install ./$GEMFILE --no-document
20
- RUN rm ./$GEMFILE
13
+ COPY $GEM_FILE ./
14
+ RUN gem install ./$GEM_FILE --no-document
15
+ RUN rm ./$GEM_FILE
21
16
 
22
- RUN gem install puma thruster
17
+ RUN gem install pitchfork thruster
23
18
  COPY config.ru ./
19
+ COPY docker/pitchfork.conf ./
24
20
 
25
21
  COPY docker/entrypoint.server.sh /usr/local/bin/entrypoint
26
22
  RUN chmod +x /usr/local/bin/entrypoint
@@ -2,6 +2,6 @@
2
2
 
3
3
  export THRUSTER_HTTP_PORT=${PORT:-5138}
4
4
  export THRUSTER_TARGET_PORT=3000
5
- export THRUSTER_HTTP_IDLE_TIMEOUT=${IDLE_TIMEOUT:-305}
5
+ export THRUSTER_HTTP_IDLE_TIMEOUT=${IDLE_TIMEOUT:-300}
6
6
 
7
- exec thrust puma --workers 0 --bind tcp://127.0.0.1:3000 --threads ${PUMA_THREADS:-1}
7
+ exec thrust pitchfork -c pitchfork.conf
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ worker_processes 1
4
+ listen "localhost:3000", backlog: 2048
5
+ timeout 301
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Specwrk
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.2"
5
5
  end
@@ -88,7 +88,7 @@ module Specwrk
88
88
 
89
89
  def route(method:, path:)
90
90
  case [method, path]
91
- when ["GET", "/health"]
91
+ when ["GET", "/health"], ["HEAD", "/health"]
92
92
  Endpoints::Health
93
93
  when ["GET", "/heartbeat"]
94
94
  Endpoints::Heartbeat
@@ -28,7 +28,7 @@ module Specwrk
28
28
  private
29
29
 
30
30
  def unauthorized
31
- [401, {"Content-Type" => "application/json"}, ["Unauthorized"]]
31
+ [401, {"content-type" => "application/json"}, ["Unauthorized"]]
32
32
  end
33
33
  end
34
34
  end
@@ -22,11 +22,11 @@ module Specwrk
22
22
  attr_reader :request
23
23
 
24
24
  def not_found
25
- [404, {"Content-Type" => "text/plain"}, ["This is not the path you're looking for, 'ol chap..."]]
25
+ [404, {"content-type" => "text/plain"}, ["This is not the path you're looking for, 'ol chap..."]]
26
26
  end
27
27
 
28
28
  def ok
29
- [200, {"Content-Type" => "text/plain"}, ["OK, 'ol chap"]]
29
+ [200, {"content-type" => "text/plain"}, ["OK, 'ol chap"]]
30
30
  end
31
31
 
32
32
  def payload
@@ -71,7 +71,7 @@ module Specwrk
71
71
 
72
72
  class Health < Base
73
73
  def response
74
- ok
74
+ [200, {}, []]
75
75
  end
76
76
  end
77
77
 
@@ -125,11 +125,11 @@ module Specwrk
125
125
  end
126
126
 
127
127
  if @examples.length.positive?
128
- [200, {"Content-Type" => "application/json"}, [JSON.generate(@examples)]]
128
+ [200, {"content-type" => "application/json"}, [JSON.generate(@examples)]]
129
129
  elsif pending_queue.length.zero? && processing_queue.length.zero? && completed_queue.length.zero?
130
- [204, {"Content-Type" => "text/plain"}, ["Waiting for sample to be seeded."]]
130
+ [204, {"content-type" => "text/plain"}, ["Waiting for sample to be seeded."]]
131
131
  elsif completed_queue.length.positive? && processing_queue.length.zero?
132
- [410, {"Content-Type" => "text/plain"}, ["That's a good lad. Run along now and go home."]]
132
+ [410, {"content-type" => "text/plain"}, ["That's a good lad. Run along now and go home."]]
133
133
  else
134
134
  not_found
135
135
  end
@@ -139,9 +139,9 @@ module Specwrk
139
139
  class Report < Base
140
140
  def response
141
141
  if data
142
- [200, {"Content-Type" => "application/json"}, [data]]
142
+ [200, {"content-type" => "application/json"}, [data]]
143
143
  else
144
- [404, {"Content-Type" => "text/plain"}, ["Unable to report on run #{run_id}; no file matching #{"*-report-#{run_id}.json"}"]]
144
+ [404, {"content-type" => "text/plain"}, ["Unable to report on run #{run_id}; no file matching #{"*-report-#{run_id}.json"}"]]
145
145
  end
146
146
  end
147
147
 
@@ -168,7 +168,7 @@ module Specwrk
168
168
  def response
169
169
  interupt! if ENV["SPECWRK_SRV_SINGLE_RUN"]
170
170
 
171
- [200, {"Content-Type" => "text/plain"}, ["✌️"]]
171
+ [200, {"content-type" => "text/plain"}, ["✌️"]]
172
172
  end
173
173
 
174
174
  def interupt!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specwrk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Westendorf
@@ -152,6 +152,7 @@ files:
152
152
  - config.ru
153
153
  - docker/Dockerfile.server
154
154
  - docker/entrypoint.server.sh
155
+ - docker/pitchfork.conf
155
156
  - exe/specwrk
156
157
  - lib/specwrk.rb
157
158
  - lib/specwrk/cli.rb