trmnlp-test 0.1.2 → 0.1.3
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/README.md +1 -0
- data/exe/trmnlp-test +14 -4
- data/lib/trmnlp_test/usage.txt +30 -0
- data/lib/trmnlp_test/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: efb7aad66d6a83a5934eded406dd8baa6518e1ce540bb25397e80331f47b0e55
|
|
4
|
+
data.tar.gz: fa3e89415e15fe30244ea93d8ca18f556f4fe1d2cd6c625b07dbbd1f48ab7e0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2fff9a02ffcd2fe841301bff6f8537ac582bfe2f494cd1026c09ae032b74baa7807a6c0b24d54c7f1cb03580902b721ddc740be458103ca8fca88ca4a37aac98
|
|
7
|
+
data.tar.gz: 2adbec49c1a68f78988ea3cab4e39a8345bf679c043dcb1e262d0c2b2f582b80058b014d580147e363692ecf5447643f000b089a3421ed37228d13cb80b839a2
|
data/README.md
CHANGED
|
@@ -23,6 +23,7 @@ trmnlp-test init # trmnlp-test.config.js + test/trmnl/plugin.spec.
|
|
|
23
23
|
trmnlp-test # run; Playwright args pass through (-g, --update-snapshots)
|
|
24
24
|
trmnlp-test models | versions # device models / framework versions
|
|
25
25
|
trmnlp-test update # pull the image now (otherwise at most once a day)
|
|
26
|
+
trmnlp-test help | --version # all commands and options / versions of trmnlp-test, trmnlp, Playwright
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
`--repo DIR` runs against another directory. `--mount DIR` mounts an extra directory.
|
data/exe/trmnlp-test
CHANGED
|
@@ -19,9 +19,19 @@ while %w[--repo --mount].include?(args.first)
|
|
|
19
19
|
flag == '--repo' ? repo = path : mounts += ['-v', "#{path}:#{path}"]
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
USAGE = File.read(File.expand_path('../lib/trmnlp_test/usage.txt', __dir__))
|
|
23
|
+
args[0] = { '-h' => 'help', '--help' => 'help', '-v' => 'version', '--version' => 'version' }.fetch(args[0], args[0]) if args.any?
|
|
22
24
|
case args.first
|
|
25
|
+
when 'help'
|
|
26
|
+
puts USAGE
|
|
27
|
+
exit
|
|
23
28
|
when 'version'
|
|
24
|
-
puts "
|
|
29
|
+
puts "launcher #{TrmnlpTest::VERSION}, image #{image}"
|
|
30
|
+
if system('docker', 'image', 'inspect', image, out: File::NULL, err: File::NULL)
|
|
31
|
+
exec 'docker', 'run', '--rm', image, 'version'
|
|
32
|
+
else
|
|
33
|
+
puts 'image not pulled yet (trmnlp-test update)'
|
|
34
|
+
end
|
|
25
35
|
exit
|
|
26
36
|
when 'update'
|
|
27
37
|
exec 'docker', 'pull', image
|
|
@@ -37,10 +47,10 @@ present = system('docker', 'image', 'inspect', image, out: File::NULL, err: File
|
|
|
37
47
|
stamp = File.join(cache, '.pulled-' + image.gsub(/[^A-Za-z0-9.]+/, '_'))
|
|
38
48
|
stale = image.end_with?(':latest') && (!File.exist?(stamp) || Time.now - File.mtime(stamp) > 86_400)
|
|
39
49
|
if !present || (stale && !ENV['TRMNLP_TEST_NO_PULL'])
|
|
40
|
-
warn "trmnlp-test: pulling #{image}"
|
|
41
|
-
pulled = system('docker', 'pull', '-q', image, out: File::NULL)
|
|
50
|
+
warn "trmnlp-test: pulling #{image}" unless present
|
|
51
|
+
pulled = system('docker', 'pull', '-q', image, out: File::NULL, err: present ? File::NULL : $stderr)
|
|
42
52
|
abort("trmnlp-test: could not pull #{image}") if !pulled && !present
|
|
43
|
-
FileUtils.touch(stamp)
|
|
53
|
+
FileUtils.touch(stamp) # checked today, whether or not the registry had it
|
|
44
54
|
end
|
|
45
55
|
entry = []
|
|
46
56
|
if args.first == 'shell'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Usage: trmnlp-test [options] [command] [args]
|
|
2
|
+
|
|
3
|
+
Tests TRMNL plugins in the trmnlp format, in Docker.
|
|
4
|
+
|
|
5
|
+
Commands:
|
|
6
|
+
run [playwright args] run the tests (default), e.g. -g "dark", --update-snapshots, -j 4
|
|
7
|
+
init create trmnlp-test.config.js and test/trmnl/plugin.spec.js
|
|
8
|
+
models list the TRMNL device models and their palettes
|
|
9
|
+
versions list the TRMNL framework versions
|
|
10
|
+
refresh re-download models, palettes and framework versions
|
|
11
|
+
update pull the newest image now (otherwise at most once a day)
|
|
12
|
+
shell open a shell in the image
|
|
13
|
+
version show the versions of trmnlp-test, trmnlp and Playwright
|
|
14
|
+
help show this help (run --help: the Playwright test options)
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
--repo DIR the plugin repository (default: the current directory)
|
|
18
|
+
--mount DIR also mount DIR into the container (repeatable)
|
|
19
|
+
--root DIR the directory with trmnlp-test.config.js, inside the repository
|
|
20
|
+
--report DIR where the report goes (default: config "report")
|
|
21
|
+
-h, --help show this help
|
|
22
|
+
-v, --version show versions
|
|
23
|
+
|
|
24
|
+
Environment:
|
|
25
|
+
TRMNLP_TEST_WORKERS parallel workers, a number or "50%" (default: half the CPUs)
|
|
26
|
+
TRMNLP_TEST_IMAGE image to run (default: ghcr.io/excusemi/trmnlp-test:latest)
|
|
27
|
+
TRMNLP_TEST_CACHE_DIR cache directory (default: ~/.cache/trmnlp-test)
|
|
28
|
+
TRMNLP_TEST_NO_PULL=1 never pull the image automatically
|
|
29
|
+
|
|
30
|
+
Docs: https://github.com/ExcuseMi/trmnlp-test
|
data/lib/trmnlp_test/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trmnlp-test
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ExcuseMi
|
|
@@ -21,6 +21,7 @@ files:
|
|
|
21
21
|
- LICENSE
|
|
22
22
|
- README.md
|
|
23
23
|
- exe/trmnlp-test
|
|
24
|
+
- lib/trmnlp_test/usage.txt
|
|
24
25
|
- lib/trmnlp_test/version.rb
|
|
25
26
|
homepage: https://github.com/ExcuseMi/trmnlp-test
|
|
26
27
|
licenses:
|