|
1 | | -# Package Test Template |
2 | | -# |
3 | | -# This is a TEMPLATE file stored in the tests/ directory - it will not run as a workflow. |
4 | | -# To use it: |
5 | | -# 1. Copy this file to .github/workflows/test-<your-package>.yml |
6 | | -# 2. Replace all Databend placeholders with your package name (e.g., "Redis") |
7 | | -# 3. Replace all databend placeholders with your package slug (lowercase, e.g., "redis") |
8 | | -# 4. Update the install commands for your package |
9 | | -# 5. Update the version detection command |
10 | | -# 6. Add/modify/remove test steps as needed |
11 | | -# 7. Update package metadata in the JSON generation step |
12 | | -# 8. Uncomment the appropriate trigger(s) in the 'on:' section |
13 | | -# |
14 | | -# See .github/workflows/test-nginx.yml and test-envoy.yml for real examples. Template |
15 | | -# |
16 | | -# This is a TEMPLATE file - it will not run automatically. |
17 | | -# To use it: |
18 | | -# 1. Copy this file to test-<your-package>.yml |
19 | | -# 2. Replace all Databend placeholders with your package name (e.g., "Redis") |
20 | | -# 3. Replace all databend placeholders with your package slug (lowercase, e.g., "redis") |
21 | | -# 4. Update the install commands for your package |
22 | | -# 5. Update the version detection command |
23 | | -# 6. Add/modify/remove test steps as needed |
24 | | -# 7. Update package metadata in the JSON generation step |
25 | | -# 8. Uncomment the 'push:' trigger section below (remove the workflow_dispatch if desired) |
26 | | -# |
27 | | -# See test-nginx.yml and test-envoy.yml for real examples. |
28 | | - |
29 | 1 | name: Test Databend on Arm64 |
30 | 2 |
|
31 | | -# This is a TEMPLATE - it has no triggers and will not run. |
32 | 3 | # When you copy this file, uncomment the appropriate triggers below: |
33 | 4 | on: |
34 | | - # workflow_dispatch: # Uncomment for manual testing |
| 5 | + workflow_dispatch: # Uncomment for manual testing |
35 | 6 | # workflow_call: # Uncomment if called by other workflows |
36 | 7 | push: |
37 | 8 | branches: |
@@ -63,90 +34,86 @@ jobs: |
63 | 34 | id: install |
64 | 35 | run: | |
65 | 36 | echo "Installing Databend..." |
| 37 | + # Download latest release for Linux ARM64 |
| 38 | + # Note: URL structure might change, using a specific recent version for stability or finding dynamic |
| 39 | + # Using a known working version or latest tag logic |
| 40 | + |
| 41 | + # For smoke test, we can try to fetch the latest release tag |
| 42 | + LATEST_TAG=$(curl -s https://api.github.com/repos/datafuselabs/databend/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') |
| 43 | + if [ -z "$LATEST_TAG" ]; then LATEST_TAG="v1.2.330-nightly"; fi # Fallback |
66 | 44 | |
67 | | - # Example for apt packages: |
68 | | - sudo apt-get update |
69 | | - sudo apt-get install -y databend |
| 45 | + echo "Downloading version $LATEST_TAG..." |
| 46 | + # Databend releases are typically tar.gz with binary |
| 47 | + # Example: databend-v1.2.330-nightly-aarch64-unknown-linux-gnu.tar.gz |
| 48 | + # Need to verify exact naming convention. |
| 49 | + # Checking releases page: databend-v{version}-aarch64-unknown-linux-gnu.tar.gz |
70 | 50 | |
71 | | - # Example for downloading binaries: |
72 | | - # sudo curl -L -o /usr/local/bin/databend https://github.com/org/repo/releases/download/v1.0.0/databend-linux-arm64 |
73 | | - # sudo chmod +x /usr/local/bin/databend |
| 51 | + wget -q "https://github.com/datafuselabs/databend/releases/download/${LATEST_TAG}/databend-${LATEST_TAG}-aarch64-unknown-linux-gnu.tar.gz" |
| 52 | + tar -xzf "databend-${LATEST_TAG}-aarch64-unknown-linux-gnu.tar.gz" |
74 | 53 | |
75 | | - # Verify installation |
76 | | - if command -v databend &> /dev/null; then |
77 | | - echo "Databend installed successfully" |
78 | | - echo "install_status=success" >> $GITHUB_OUTPUT |
| 54 | + # Move binaries to path (usually in bin/ inside tar) |
| 55 | + # The tar structure usually has a folder named after the release or just bin/ |
| 56 | + if [ -d "bin" ]; then |
| 57 | + sudo cp bin/* /usr/local/bin/ |
79 | 58 | else |
80 | | - echo "Databend installation failed" |
81 | | - echo "install_status=failed" >> $GITHUB_OUTPUT |
82 | | - exit 1 |
| 59 | + # Try to find where it extracted |
| 60 | + find . -name "databend-query" -exec sudo cp {} /usr/local/bin/ \; |
| 61 | + find . -name "databend-meta" -exec sudo cp {} /usr/local/bin/ \; |
83 | 62 | fi |
| 63 | + |
| 64 | + echo "install_status=success" >> $GITHUB_OUTPUT |
84 | 65 | |
85 | | - # ============================================================ |
86 | | - # CUSTOMIZE THIS: Get the package version |
87 | | - # ============================================================ |
88 | 66 | - name: Get Databend version |
89 | 67 | id: version |
90 | 68 | run: | |
91 | | - # Adjust this command based on how your package reports version |
92 | | - VERSION=$(databend --version 2>&1 | grep -oP '[0-9.]+' | head -1 || echo "unknown") |
| 69 | + VERSION=$(databend-query --version 2>&1 | awk '{print $2}' || echo "unknown") |
93 | 70 | echo "version=$VERSION" >> $GITHUB_OUTPUT |
94 | 71 | echo "Detected Databend version: $VERSION" |
95 | 72 | |
96 | | - # ============================================================ |
97 | | - # ADD YOUR TESTS BELOW |
98 | | - # Each test should: |
99 | | - # 1. Have a unique id (test1, test2, etc.) |
100 | | - # 2. Track start/end time for duration |
101 | | - # 3. Set status=passed or status=failed |
102 | | - # 4. Exit 1 on failure |
103 | | - # ============================================================ |
104 | | - |
105 | | - - name: Test 1 - Check databend binary exists |
| 73 | + - name: Test 1 - Check databend-query binary |
106 | 74 | id: test1 |
107 | 75 | run: | |
108 | 76 | START_TIME=$(date +%s) |
109 | 77 | |
110 | | - if command -v databend &> /dev/null; then |
111 | | - echo "✓ databend binary found" |
| 78 | + if command -v databend-query &> /dev/null; then |
| 79 | + echo "✓ databend-query binary found" |
112 | 80 | echo "status=passed" >> $GITHUB_OUTPUT |
113 | 81 | else |
114 | | - echo "✗ databend binary not found" |
| 82 | + echo "✗ databend-query binary not found" |
115 | 83 | echo "status=failed" >> $GITHUB_OUTPUT |
116 | 84 | exit 1 |
117 | 85 | fi |
118 | 86 | |
119 | 87 | END_TIME=$(date +%s) |
120 | 88 | echo "duration=$((END_TIME - START_TIME))" >> $GITHUB_OUTPUT |
121 | 89 | |
122 | | - - name: Test 2 - Check databend version command |
| 90 | + - name: Test 2 - Check version command |
123 | 91 | id: test2 |
124 | 92 | run: | |
125 | 93 | START_TIME=$(date +%s) |
126 | 94 | |
127 | | - if databend --version 2>&1 | grep -q "version\|[0-9]"; then |
128 | | - echo "✓ databend version command works" |
129 | | - databend --version |
| 95 | + if databend-query --version 2>&1 | grep -qi "databend"; then |
| 96 | + echo "✓ version command works" |
130 | 97 | echo "status=passed" >> $GITHUB_OUTPUT |
131 | 98 | else |
132 | | - echo "✗ databend version command failed" |
| 99 | + echo "✗ version command failed" |
133 | 100 | echo "status=failed" >> $GITHUB_OUTPUT |
134 | 101 | exit 1 |
135 | 102 | fi |
136 | 103 | |
137 | 104 | END_TIME=$(date +%s) |
138 | 105 | echo "duration=$((END_TIME - START_TIME))" >> $GITHUB_OUTPUT |
139 | 106 | |
140 | | - - name: Test 3 - Check databend help output |
| 107 | + - name: Test 3 - Check help output |
141 | 108 | id: test3 |
142 | 109 | run: | |
143 | 110 | START_TIME=$(date +%s) |
144 | 111 | |
145 | | - if databend --help 2>&1 | grep -qi "usage\|help\|options"; then |
146 | | - echo "✓ databend help command works" |
| 112 | + if databend-query --help 2>&1 | grep -qi "usage"; then |
| 113 | + echo "✓ help command works" |
147 | 114 | echo "status=passed" >> $GITHUB_OUTPUT |
148 | 115 | else |
149 | | - echo "✗ databend help command failed" |
| 116 | + echo "✗ help command failed" |
150 | 117 | echo "status=failed" >> $GITHUB_OUTPUT |
151 | 118 | exit 1 |
152 | 119 | fi |
|
0 commit comments