File tree Expand file tree Collapse file tree 10 files changed +126
-41
lines changed
Expand file tree Collapse file tree 10 files changed +126
-41
lines changed Original file line number Diff line number Diff line change 1+ -P ubuntu-latest=catthehacker/ubuntu:act-latest
2+ --container-daemon-socket /var/run/docker.sock
Original file line number Diff line number Diff line change 99 " features" ,
1010 " test" ,
1111 " --features" ,
12- " devbox" ,
13- " ${localWorkspaceFolder} " ,
12+ " jetify- devbox" ,
13+ " ${workspaceFolder} "
1414 ],
1515 "group" : " test" ,
1616 "problemMatcher" : []
17+ },
18+ {
19+ "type" : " shell" ,
20+ "label" : " Run GitHub Actions Locally (act)" ,
21+ "command" : " act" ,
22+ "args" : [
23+ " --container-architecture" ,
24+ " linux/amd64"
25+ ],
26+ "group" : " test" ,
27+ "problemMatcher" : [],
28+ "options" : {
29+ "cwd" : " ${workspaceFolder}"
30+ },
31+ "presentation" : {
32+ "echo" : true ,
33+ "reveal" : " always" ,
34+ "focus" : false ,
35+ "panel" : " shared" ,
36+ "showReuseMessage" : true ,
37+ "clear" : false
38+ }
39+ },
40+ {
41+ "type" : " shell" ,
42+ "label" : " Run GitHub Actions - Test Scenarios (act)" ,
43+ "command" : " act" ,
44+ "args" : [
45+ " -j" ,
46+ " test-scenarios" ,
47+ " --container-architecture" ,
48+ " linux/amd64"
49+ ],
50+ "group" : " test" ,
51+ "problemMatcher" : [],
52+ "options" : {
53+ "cwd" : " ${workspaceFolder}"
54+ },
55+ "presentation" : {
56+ "echo" : true ,
57+ "reveal" : " always" ,
58+ "focus" : false ,
59+ "panel" : " shared" ,
60+ "showReuseMessage" : true ,
61+ "clear" : false
62+ }
1763 }
1864 ]
1965}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11{
2- "auto_update_enabled " : {
2+ "test_auto_update_enabled " : {
33 "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
44 "features" : {
55 "jetify-devbox" : {
66 "autoUpdate" : true
77 }
8- },
9- "mounts" : [
10- " source=${PWD}/test-assets,target=/tmp/test-assets,type=bind"
11- ],
12- "onCreateCommand" : " cp /tmp/test-assets/devbox.json ."
8+ }
139 },
14- "auto_update_disabled " : {
10+ "test_auto_update_disabled " : {
1511 "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
1612 "features" : {
1713 "jetify-devbox" : {
2622 "autoUpdate" : true
2723 }
2824 },
29- "mounts" : [
30- " source=${PWD}/test-assets,target=/tmp/test-assets,type=bind"
31- ],
32- "onCreateCommand" : " cp /tmp/test-assets/devbox.json ." ,
3325 "customizations" : {
3426 "vscode" : {
3527 "settings" : {
Original file line number Diff line number Diff line change 1+ #! /bin/bash
12# ==================================================
23# test/jetify-devbox/test.sh - Basic functionality test
34# ==================================================
4- #! /bin/bash
55set -e
66
77# Import test library
@@ -18,7 +18,7 @@ check "devbox in PATH" which devbox
1818check " can initialize devbox" bash -c " devbox init && test -f devbox.json"
1919
2020# Test that devbox shell works
21- check " devbox shell works" devbox shell -- echo ' Shell test passed'
21+ check " devbox shell works" bash -c " echo 'echo Shell test passed' | devbox shell "
2222
2323# Cleanup
2424rm -f devbox.json devbox.lock
Original file line number Diff line number Diff line change 66
77source dev-container-features-test-lib
88
9+ # Create devbox.json to simulate the onCreateCommand
10+ cat > devbox.json << 'EOF '
11+ {
12+ "packages": [
13+ "python@3.11",
14+ "nodejs@18",
15+ "jq@latest"
16+ ],
17+ "shell": {
18+ "init_hook": [
19+ "echo 'Welcome to Devbox!'"
20+ ]
21+ }
22+ }
23+ EOF
24+
925# Check that the post-setup script was created
1026check " post-setup script exists" test -f /usr/local/share/devbox-post-setup.sh
1127
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ echo " Testing Devbox feature on different base image (ubuntu:jammy)..."
6+
7+ source dev-container-features-test-lib
8+
9+ check " devbox is installed" which devbox
10+ check " devbox version works" devbox version
11+ check " devbox feature installed env var" bash -c " [ \"\$ DEVBOX_FEATURE_INSTALLED\" = 'true' ]"
12+
13+ check " post-setup script exists" test -f /usr/local/share/devbox-post-setup.sh
14+ check " manual setup script exists" test -f /usr/local/bin/devbox-setup
15+ check " auto-update flag exists" test -f /usr/local/share/devbox-auto-update-enabled
16+
17+ check " devbox init works" bash -c " cd /tmp && devbox init"
18+ check " devbox.json created" test -f /tmp/devbox.json
19+
20+ reportResults
Original file line number Diff line number Diff line change 66
77source dev-container-features-test-lib
88
9+ # Create devbox.json to test integration
10+ cat > devbox.json << 'EOF '
11+ {
12+ "packages": [
13+ "python@3.11",
14+ "nodejs@18",
15+ "jq@latest"
16+ ],
17+ "shell": {
18+ "init_hook": [
19+ "echo 'Welcome to Devbox!'"
20+ ]
21+ }
22+ }
23+ EOF
24+
925# Check devbox was installed
1026check " devbox installed" devbox version
1127
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ echo " Testing Devbox feature with user onCreate command..."
6+
7+ source dev-container-features-test-lib
8+
9+ check " devbox is installed" which devbox
10+ check " devbox version works" devbox version
11+ check " devbox feature installed env var" bash -c " [ \"\$ DEVBOX_FEATURE_INSTALLED\" = 'true' ]"
12+
13+ check " user onCreate command ran" test -f /tmp/user-oncreate.log
14+ check " user onCreate content" grep " User onCreate ran after feature" /tmp/user-oncreate.log
15+
16+ check " post-setup script exists" test -f /usr/local/share/devbox-post-setup.sh
17+ check " manual setup script exists" test -f /usr/local/bin/devbox-setup
18+
19+ reportResults
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments