Skip to content

Commit 9fee871

Browse files
authored
Adds xprocess and ephemeral port reserve to control jekyll from test (#482)
* update requirements * adds pytest-xprocess * adds ephemeral_port_reserve to requirements * refactor tests to use use xprocess * adds conftest * Updates Playwright.yml - removes jekyll call now that tests call it - updates python version to 3.12 (from 3.11)
1 parent f0de3e6 commit 9fee871

File tree

7 files changed

+221
-158
lines changed

7 files changed

+221
-158
lines changed

.github/workflows/playwright.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,17 @@ jobs:
1919
- name: Set up Python
2020
uses: actions/setup-python@v4
2121
with:
22-
python-version: "3.11"
22+
python-version: "3.12"
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip
2626
pip install -r requirements-dev.txt
27-
python -m playwright install --with-deps
27+
python -m playwright install --with-deps chromium
2828
- name: Set up Ruby
2929
uses: ruby/setup-ruby@v1
3030
with:
3131
bundler-cache: true
32-
- name: Jekyll detached and pytest
33-
run: |
34-
# Start up local copy of site
35-
bundle exec jekyll serve --detach
36-
37-
# Sleep for 5 secs to allow Jekyll to start
38-
startup_wait=5
39-
echo "Sleeping for $startup_wait seconds"
40-
sleep $startup_wait
41-
4232
# Run tests
33+
- name: Run Tests
34+
run: |
4335
python -m pytest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ _site/
1515
.bundle/
1616
vendor/
1717
2
18+
test_images
19+
*-version

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.2
1+
3.3.4

Gemfile.lock

Lines changed: 100 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.1.3.2)
4+
activesupport (7.2.1)
55
base64
66
bigdecimal
7-
concurrent-ruby (~> 1.0, >= 1.0.2)
7+
concurrent-ruby (~> 1.0, >= 1.3.1)
88
connection_pool (>= 2.2.5)
99
drb
1010
i18n (>= 1.6, < 2)
11+
logger (>= 1.4.2)
1112
minitest (>= 5.1)
12-
mutex_m
13-
tzinfo (~> 2.0)
14-
addressable (2.8.6)
15-
public_suffix (>= 2.0.2, < 6.0)
13+
securerandom (>= 0.3)
14+
tzinfo (~> 2.0, >= 2.0.5)
15+
addressable (2.8.7)
16+
public_suffix (>= 2.0.2, < 7.0)
1617
base64 (0.2.0)
17-
bigdecimal (3.1.7)
18+
bigdecimal (3.1.8)
1819
coffee-script (2.4.1)
1920
coffee-script-source
2021
execjs
21-
coffee-script-source (1.11.1)
22+
coffee-script-source (1.12.2)
2223
colorator (1.1.0)
2324
commonmarker (0.23.10)
24-
concurrent-ruby (1.2.3)
25+
concurrent-ruby (1.3.4)
2526
connection_pool (2.4.1)
26-
dnsruby (1.71.0)
27+
csv (3.3.0)
28+
dnsruby (1.72.2)
2729
simpleidn (~> 0.2.1)
2830
drb (2.2.1)
2931
em-websocket (0.5.3)
@@ -33,24 +35,34 @@ GEM
3335
ffi (>= 1.15.0)
3436
eventmachine (1.2.7)
3537
execjs (2.9.1)
36-
faraday (2.9.0)
37-
faraday-net_http (>= 2.0, < 3.2)
38-
faraday-net_http (3.1.0)
38+
faraday (2.12.0)
39+
faraday-net_http (>= 2.0, < 3.4)
40+
json
41+
logger
42+
faraday-net_http (3.3.0)
3943
net-http
40-
ffi (1.16.3)
41-
ffi (1.16.3-x64-mingw-ucrt)
44+
ffi (1.17.0-aarch64-linux-gnu)
45+
ffi (1.17.0-aarch64-linux-musl)
46+
ffi (1.17.0-arm-linux-gnu)
47+
ffi (1.17.0-arm-linux-musl)
48+
ffi (1.17.0-arm64-darwin)
49+
ffi (1.17.0-x86-linux-gnu)
50+
ffi (1.17.0-x86-linux-musl)
51+
ffi (1.17.0-x86_64-darwin)
52+
ffi (1.17.0-x86_64-linux-gnu)
53+
ffi (1.17.0-x86_64-linux-musl)
4254
forwardable-extended (2.6.0)
43-
gemoji (3.0.1)
44-
github-pages (228)
45-
github-pages-health-check (= 1.17.9)
46-
jekyll (= 3.9.3)
47-
jekyll-avatar (= 0.7.0)
48-
jekyll-coffeescript (= 1.1.1)
49-
jekyll-commonmark-ghpages (= 0.4.0)
50-
jekyll-default-layout (= 0.1.4)
51-
jekyll-feed (= 0.15.1)
55+
gemoji (4.1.0)
56+
github-pages (232)
57+
github-pages-health-check (= 1.18.2)
58+
jekyll (= 3.10.0)
59+
jekyll-avatar (= 0.8.0)
60+
jekyll-coffeescript (= 1.2.2)
61+
jekyll-commonmark-ghpages (= 0.5.1)
62+
jekyll-default-layout (= 0.1.5)
63+
jekyll-feed (= 0.17.0)
5264
jekyll-gist (= 1.5.0)
53-
jekyll-github-metadata (= 2.13.0)
65+
jekyll-github-metadata (= 2.16.1)
5466
jekyll-include-cache (= 0.2.1)
5567
jekyll-mentions (= 1.6.0)
5668
jekyll-optional-front-matter (= 0.3.2)
@@ -77,30 +89,32 @@ GEM
7789
jekyll-theme-tactile (= 0.2.0)
7890
jekyll-theme-time-machine (= 0.2.0)
7991
jekyll-titles-from-headings (= 0.5.3)
80-
jemoji (= 0.12.0)
81-
kramdown (= 2.3.2)
92+
jemoji (= 0.13.0)
93+
kramdown (= 2.4.0)
8294
kramdown-parser-gfm (= 1.1.0)
8395
liquid (= 4.0.4)
8496
mercenary (~> 0.3)
8597
minima (= 2.5.1)
86-
nokogiri (>= 1.13.6, < 2.0)
87-
rouge (= 3.26.0)
98+
nokogiri (>= 1.16.2, < 2.0)
99+
rouge (= 3.30.0)
88100
terminal-table (~> 1.4)
89-
github-pages-health-check (1.17.9)
101+
webrick (~> 1.8)
102+
github-pages-health-check (1.18.2)
90103
addressable (~> 2.3)
91104
dnsruby (~> 1.60)
92-
octokit (~> 4.0)
93-
public_suffix (>= 3.0, < 5.0)
105+
octokit (>= 4, < 8)
106+
public_suffix (>= 3.0, < 6.0)
94107
typhoeus (~> 1.3)
95108
html-pipeline (2.14.3)
96109
activesupport (>= 2)
97110
nokogiri (>= 1.4)
98111
http_parser.rb (0.8.0)
99-
i18n (1.14.4)
112+
i18n (1.14.6)
100113
concurrent-ruby (~> 1.0)
101-
jekyll (3.9.3)
114+
jekyll (3.10.0)
102115
addressable (~> 2.4)
103116
colorator (~> 1.0)
117+
csv (~> 3.0)
104118
em-websocket (~> 0.5)
105119
i18n (>= 0.7, < 2)
106120
jekyll-sass-converter (~> 1.0)
@@ -111,27 +125,28 @@ GEM
111125
pathutil (~> 0.9)
112126
rouge (>= 1.7, < 4)
113127
safe_yaml (~> 1.0)
114-
jekyll-avatar (0.7.0)
128+
webrick (>= 1.0)
129+
jekyll-avatar (0.8.0)
115130
jekyll (>= 3.0, < 5.0)
116-
jekyll-coffeescript (1.1.1)
131+
jekyll-coffeescript (1.2.2)
117132
coffee-script (~> 2.2)
118-
coffee-script-source (~> 1.11.1)
133+
coffee-script-source (~> 1.12)
119134
jekyll-commonmark (1.4.0)
120135
commonmarker (~> 0.22)
121-
jekyll-commonmark-ghpages (0.4.0)
122-
commonmarker (~> 0.23.7)
123-
jekyll (~> 3.9.0)
136+
jekyll-commonmark-ghpages (0.5.1)
137+
commonmarker (>= 0.23.7, < 1.1.0)
138+
jekyll (>= 3.9, < 4.0)
124139
jekyll-commonmark (~> 1.4.0)
125140
rouge (>= 2.0, < 5.0)
126-
jekyll-default-layout (0.1.4)
127-
jekyll (~> 3.0)
128-
jekyll-feed (0.15.1)
141+
jekyll-default-layout (0.1.5)
142+
jekyll (>= 3.0, < 5.0)
143+
jekyll-feed (0.17.0)
129144
jekyll (>= 3.7, < 5.0)
130145
jekyll-gist (1.5.0)
131146
octokit (~> 4.2)
132-
jekyll-github-metadata (2.13.0)
147+
jekyll-github-metadata (2.16.1)
133148
jekyll (>= 3.4, < 5.0)
134-
octokit (~> 4.0, != 4.4.0)
149+
octokit (>= 4, < 7, != 4.4.0)
135150
jekyll-include-cache (0.2.1)
136151
jekyll (>= 3.7, < 5.0)
137152
jekyll-mentions (1.6.0)
@@ -202,43 +217,52 @@ GEM
202217
jekyll (>= 3.3, < 5.0)
203218
jekyll-watch (2.2.1)
204219
listen (~> 3.0)
205-
jemoji (0.12.0)
206-
gemoji (~> 3.0)
220+
jemoji (0.13.0)
221+
gemoji (>= 3, < 5)
207222
html-pipeline (~> 2.2)
208223
jekyll (>= 3.0, < 5.0)
209-
kramdown (2.3.2)
224+
json (2.7.2)
225+
kramdown (2.4.0)
210226
rexml
211227
kramdown-parser-gfm (1.1.0)
212228
kramdown (~> 2.0)
213229
liquid (4.0.4)
214230
listen (3.9.0)
215231
rb-fsevent (~> 0.10, >= 0.10.3)
216232
rb-inotify (~> 0.9, >= 0.9.10)
233+
logger (1.6.1)
217234
mercenary (0.3.6)
218235
minima (2.5.1)
219236
jekyll (>= 3.5, < 5.0)
220237
jekyll-feed (~> 0.9)
221238
jekyll-seo-tag (~> 2.1)
222-
minitest (5.22.3)
223-
mutex_m (0.2.0)
239+
minitest (5.25.1)
224240
net-http (0.4.1)
225241
uri
226-
nokogiri (1.16.3-x64-mingw-ucrt)
242+
nokogiri (1.16.7-aarch64-linux)
243+
racc (~> 1.4)
244+
nokogiri (1.16.7-arm-linux)
245+
racc (~> 1.4)
246+
nokogiri (1.16.7-arm64-darwin)
247+
racc (~> 1.4)
248+
nokogiri (1.16.7-x86-linux)
249+
racc (~> 1.4)
250+
nokogiri (1.16.7-x86_64-darwin)
227251
racc (~> 1.4)
228-
nokogiri (1.16.3-x86_64-linux)
252+
nokogiri (1.16.7-x86_64-linux)
229253
racc (~> 1.4)
230254
octokit (4.25.1)
231255
faraday (>= 1, < 3)
232256
sawyer (~> 0.9)
233257
pathutil (0.16.2)
234258
forwardable-extended (~> 2.6)
235-
public_suffix (4.0.7)
236-
racc (1.7.3)
259+
public_suffix (5.1.1)
260+
racc (1.8.1)
237261
rb-fsevent (0.11.2)
238-
rb-inotify (0.10.1)
262+
rb-inotify (0.11.1)
239263
ffi (~> 1.0)
240-
rexml (3.2.6)
241-
rouge (3.26.0)
264+
rexml (3.3.7)
265+
rouge (3.30.0)
242266
rubyzip (2.3.2)
243267
safe_yaml (1.0.5)
244268
sass (3.7.4)
@@ -249,27 +273,33 @@ GEM
249273
sawyer (0.9.2)
250274
addressable (>= 2.3.5)
251275
faraday (>= 0.17.3, < 3)
252-
simpleidn (0.2.1)
253-
unf (~> 0.1.4)
276+
securerandom (0.3.1)
277+
simpleidn (0.2.3)
254278
terminal-table (1.8.0)
255279
unicode-display_width (~> 1.1, >= 1.1.1)
256280
typhoeus (1.4.1)
257281
ethon (>= 0.9.0)
258282
tzinfo (2.0.6)
259283
concurrent-ruby (~> 1.0)
260-
tzinfo-data (1.2024.1)
261-
tzinfo (>= 1.0.0)
262-
unf (0.1.4)
263-
unf_ext
264-
unf_ext (0.0.9.1)
265-
unf_ext (0.0.9.1-x64-mingw-ucrt)
266284
unicode-display_width (1.8.0)
267-
uri (0.13.0)
268-
webrick (1.8.1)
285+
uri (0.13.1)
286+
webrick (1.8.2)
269287

270288
PLATFORMS
271-
x64-mingw-ucrt
289+
aarch64-linux
290+
aarch64-linux-gnu
291+
aarch64-linux-musl
292+
arm-linux
293+
arm-linux-gnu
294+
arm-linux-musl
295+
arm64-darwin
296+
x86-linux
297+
x86-linux-gnu
298+
x86-linux-musl
299+
x86_64-darwin
272300
x86_64-linux
301+
x86_64-linux-gnu
302+
x86_64-linux-musl
273303

274304
DEPENDENCIES
275305
github-pages
@@ -281,7 +311,7 @@ DEPENDENCIES
281311
webrick (~> 1.7)
282312

283313
RUBY VERSION
284-
ruby 3.2.2p53
314+
ruby 3.3.4p94
285315

286316
BUNDLED WITH
287-
2.4.10
317+
2.5.11

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
black
2+
ephemeral_port_reserve
23
pre-commit
34
pytest-pyodide
45
pytest-playwright
6+
pytest-xprocess
57
PyGithub
68
PyYAML

tests/conftest.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import pytest
2+
import ephemeral_port_reserve
3+
4+
5+
@pytest.fixture(scope="module")
6+
def url_port() -> tuple[str, int]:
7+
"""returns the localhost and port"""
8+
hostname = ephemeral_port_reserve.LOCALHOST
9+
free_port = ephemeral_port_reserve.reserve(hostname)
10+
url = f"http://{hostname}:{free_port}"
11+
return url, free_port
12+
13+
14+
ROUTES = [
15+
"",
16+
"blog",
17+
"about",
18+
"events",
19+
"community",
20+
"leadership",
21+
]
22+
23+
24+
@pytest.fixture(params=ROUTES)
25+
def loaded_route(request):
26+
return request.param
27+
28+
29+
PROFILES = [
30+
"iPhone 15",
31+
"iPhone 15 landscape",
32+
"iPhone 15 Plus",
33+
"iPhone 15 Plus landscape",
34+
]
35+
36+
37+
@pytest.fixture(scope="session", params=PROFILES)
38+
def loaded_profile(request):
39+
return request.param

0 commit comments

Comments
 (0)