s3-go-tests.yml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. name: "S3 Go Tests"
  2. on:
  3. pull_request:
  4. concurrency:
  5. group: ${{ github.head_ref }}/s3-go-tests
  6. cancel-in-progress: true
  7. permissions:
  8. contents: read
  9. defaults:
  10. run:
  11. working-directory: weed
  12. jobs:
  13. s3-versioning-tests:
  14. name: S3 Versioning Tests
  15. runs-on: ubuntu-22.04
  16. timeout-minutes: 30
  17. strategy:
  18. matrix:
  19. test-type: ["quick", "comprehensive"]
  20. steps:
  21. - name: Check out code
  22. uses: actions/checkout@v5
  23. - name: Set up Go
  24. uses: actions/setup-go@v6
  25. with:
  26. go-version-file: 'go.mod'
  27. id: go
  28. - name: Install SeaweedFS
  29. run: |
  30. go install -buildvcs=false
  31. - name: Run S3 Versioning Tests - ${{ matrix.test-type }}
  32. timeout-minutes: 25
  33. working-directory: test/s3/versioning
  34. run: |
  35. set -x
  36. echo "=== System Information ==="
  37. uname -a
  38. free -h
  39. df -h
  40. echo "=== Starting Tests ==="
  41. # Run tests with automatic server management
  42. # The test-with-server target handles server startup/shutdown automatically
  43. if [ "${{ matrix.test-type }}" = "quick" ]; then
  44. # Override TEST_PATTERN for quick tests only
  45. make test-with-server TEST_PATTERN="TestBucketListReturnDataVersioning|TestVersioningBasicWorkflow|TestVersioningDeleteMarkers"
  46. else
  47. # Run all versioning tests
  48. make test-with-server
  49. fi
  50. - name: Show server logs on failure
  51. if: failure()
  52. working-directory: test/s3/versioning
  53. run: |
  54. echo "=== Server Logs ==="
  55. if [ -f weed-test.log ]; then
  56. echo "Last 100 lines of server logs:"
  57. tail -100 weed-test.log
  58. else
  59. echo "No server log file found"
  60. fi
  61. echo "=== Test Environment ==="
  62. ps aux | grep -E "(weed|test)" || true
  63. netstat -tlnp | grep -E "(8333|9333|8080)" || true
  64. - name: Upload test logs on failure
  65. if: failure()
  66. uses: actions/upload-artifact@v4
  67. with:
  68. name: s3-versioning-test-logs-${{ matrix.test-type }}
  69. path: test/s3/versioning/weed-test*.log
  70. retention-days: 3
  71. s3-versioning-compatibility:
  72. name: S3 Versioning Compatibility Test
  73. runs-on: ubuntu-22.04
  74. timeout-minutes: 20
  75. steps:
  76. - name: Check out code
  77. uses: actions/checkout@v5
  78. - name: Set up Go
  79. uses: actions/setup-go@v6
  80. with:
  81. go-version-file: 'go.mod'
  82. id: go
  83. - name: Install SeaweedFS
  84. run: |
  85. go install -buildvcs=false
  86. - name: Run Core Versioning Test (Python s3tests equivalent)
  87. timeout-minutes: 15
  88. working-directory: test/s3/versioning
  89. run: |
  90. set -x
  91. echo "=== System Information ==="
  92. uname -a
  93. free -h
  94. # Run the specific test that is equivalent to the Python s3tests
  95. make test-with-server || {
  96. echo "❌ Test failed, checking logs..."
  97. if [ -f weed-test.log ]; then
  98. echo "=== Server logs ==="
  99. tail -100 weed-test.log
  100. fi
  101. echo "=== Process information ==="
  102. ps aux | grep -E "(weed|test)" || true
  103. exit 1
  104. }
  105. - name: Upload server logs on failure
  106. if: failure()
  107. uses: actions/upload-artifact@v4
  108. with:
  109. name: s3-versioning-compatibility-logs
  110. path: test/s3/versioning/weed-test*.log
  111. retention-days: 3
  112. s3-cors-compatibility:
  113. name: S3 CORS Compatibility Test
  114. runs-on: ubuntu-22.04
  115. timeout-minutes: 20
  116. steps:
  117. - name: Check out code
  118. uses: actions/checkout@v5
  119. - name: Set up Go
  120. uses: actions/setup-go@v6
  121. with:
  122. go-version-file: 'go.mod'
  123. id: go
  124. - name: Install SeaweedFS
  125. run: |
  126. go install -buildvcs=false
  127. - name: Run Core CORS Test (AWS S3 compatible)
  128. timeout-minutes: 15
  129. working-directory: test/s3/cors
  130. run: |
  131. set -x
  132. echo "=== System Information ==="
  133. uname -a
  134. free -h
  135. # Run the specific test that is equivalent to AWS S3 CORS behavior
  136. make test-with-server || {
  137. echo "❌ Test failed, checking logs..."
  138. if [ -f weed-test.log ]; then
  139. echo "=== Server logs ==="
  140. tail -100 weed-test.log
  141. fi
  142. echo "=== Process information ==="
  143. ps aux | grep -E "(weed|test)" || true
  144. exit 1
  145. }
  146. - name: Upload server logs on failure
  147. if: failure()
  148. uses: actions/upload-artifact@v4
  149. with:
  150. name: s3-cors-compatibility-logs
  151. path: test/s3/cors/weed-test*.log
  152. retention-days: 3
  153. s3-retention-tests:
  154. name: S3 Retention Tests
  155. runs-on: ubuntu-22.04
  156. timeout-minutes: 30
  157. strategy:
  158. matrix:
  159. test-type: ["quick", "comprehensive"]
  160. steps:
  161. - name: Check out code
  162. uses: actions/checkout@v5
  163. - name: Set up Go
  164. uses: actions/setup-go@v6
  165. with:
  166. go-version-file: 'go.mod'
  167. id: go
  168. - name: Install SeaweedFS
  169. run: |
  170. go install -buildvcs=false
  171. - name: Run S3 Retention Tests - ${{ matrix.test-type }}
  172. timeout-minutes: 25
  173. working-directory: test/s3/retention
  174. run: |
  175. set -x
  176. echo "=== System Information ==="
  177. uname -a
  178. free -h
  179. df -h
  180. echo "=== Starting Tests ==="
  181. # Run tests with automatic server management
  182. # The test-with-server target handles server startup/shutdown automatically
  183. if [ "${{ matrix.test-type }}" = "quick" ]; then
  184. # Override TEST_PATTERN for quick tests only
  185. make test-with-server TEST_PATTERN="TestBasicRetentionWorkflow|TestRetentionModeCompliance|TestLegalHoldWorkflow"
  186. else
  187. # Run all retention tests
  188. make test-with-server
  189. fi
  190. - name: Show server logs on failure
  191. if: failure()
  192. working-directory: test/s3/retention
  193. run: |
  194. echo "=== Server Logs ==="
  195. if [ -f weed-test.log ]; then
  196. echo "Last 100 lines of server logs:"
  197. tail -100 weed-test.log
  198. else
  199. echo "No server log file found"
  200. fi
  201. echo "=== Test Environment ==="
  202. ps aux | grep -E "(weed|test)" || true
  203. netstat -tlnp | grep -E "(8333|9333|8080)" || true
  204. - name: Upload test logs on failure
  205. if: failure()
  206. uses: actions/upload-artifact@v4
  207. with:
  208. name: s3-retention-test-logs-${{ matrix.test-type }}
  209. path: test/s3/retention/weed-test*.log
  210. retention-days: 3
  211. s3-cors-tests:
  212. name: S3 CORS Tests
  213. runs-on: ubuntu-22.04
  214. timeout-minutes: 30
  215. strategy:
  216. matrix:
  217. test-type: ["quick", "comprehensive"]
  218. steps:
  219. - name: Check out code
  220. uses: actions/checkout@v5
  221. - name: Set up Go
  222. uses: actions/setup-go@v6
  223. with:
  224. go-version-file: 'go.mod'
  225. id: go
  226. - name: Install SeaweedFS
  227. run: |
  228. go install -buildvcs=false
  229. - name: Run S3 CORS Tests - ${{ matrix.test-type }}
  230. timeout-minutes: 25
  231. working-directory: test/s3/cors
  232. run: |
  233. set -x
  234. echo "=== System Information ==="
  235. uname -a
  236. free -h
  237. df -h
  238. echo "=== Starting Tests ==="
  239. # Run tests with automatic server management
  240. # The test-with-server target handles server startup/shutdown automatically
  241. if [ "${{ matrix.test-type }}" = "quick" ]; then
  242. # Override TEST_PATTERN for quick tests only
  243. make test-with-server TEST_PATTERN="TestCORSConfigurationManagement|TestServiceLevelCORS|TestCORSBasicWorkflow"
  244. else
  245. # Run all CORS tests
  246. make test-with-server
  247. fi
  248. - name: Show server logs on failure
  249. if: failure()
  250. working-directory: test/s3/cors
  251. run: |
  252. echo "=== Server Logs ==="
  253. if [ -f weed-test.log ]; then
  254. echo "Last 100 lines of server logs:"
  255. tail -100 weed-test.log
  256. else
  257. echo "No server log file found"
  258. fi
  259. echo "=== Test Environment ==="
  260. ps aux | grep -E "(weed|test)" || true
  261. netstat -tlnp | grep -E "(8333|9333|8080)" || true
  262. - name: Upload test logs on failure
  263. if: failure()
  264. uses: actions/upload-artifact@v4
  265. with:
  266. name: s3-cors-test-logs-${{ matrix.test-type }}
  267. path: test/s3/cors/weed-test*.log
  268. retention-days: 3
  269. s3-retention-worm:
  270. name: S3 Retention WORM Integration Test
  271. runs-on: ubuntu-22.04
  272. timeout-minutes: 20
  273. steps:
  274. - name: Check out code
  275. uses: actions/checkout@v5
  276. - name: Set up Go
  277. uses: actions/setup-go@v6
  278. with:
  279. go-version-file: 'go.mod'
  280. id: go
  281. - name: Install SeaweedFS
  282. run: |
  283. go install -buildvcs=false
  284. - name: Run WORM Integration Tests
  285. timeout-minutes: 15
  286. working-directory: test/s3/retention
  287. run: |
  288. set -x
  289. echo "=== System Information ==="
  290. uname -a
  291. free -h
  292. # Run the WORM integration tests with automatic server management
  293. # The test-with-server target handles server startup/shutdown automatically
  294. make test-with-server TEST_PATTERN="TestWORM|TestRetentionExtendedAttributes|TestRetentionConcurrentOperations" || {
  295. echo "❌ WORM integration test failed, checking logs..."
  296. if [ -f weed-test.log ]; then
  297. echo "=== Server logs ==="
  298. tail -100 weed-test.log
  299. fi
  300. echo "=== Process information ==="
  301. ps aux | grep -E "(weed|test)" || true
  302. exit 1
  303. }
  304. - name: Upload server logs on failure
  305. if: failure()
  306. uses: actions/upload-artifact@v4
  307. with:
  308. name: s3-retention-worm-logs
  309. path: test/s3/retention/weed-test*.log
  310. retention-days: 3
  311. s3-versioning-stress:
  312. name: S3 Versioning Stress Test
  313. runs-on: ubuntu-22.04
  314. timeout-minutes: 35
  315. # Only run stress tests on master branch pushes to avoid overloading PR testing
  316. if: github.event_name == 'push' && github.ref == 'refs/heads/master'
  317. steps:
  318. - name: Check out code
  319. uses: actions/checkout@v5
  320. - name: Set up Go
  321. uses: actions/setup-go@v6
  322. with:
  323. go-version-file: 'go.mod'
  324. id: go
  325. - name: Install SeaweedFS
  326. run: |
  327. go install -buildvcs=false
  328. - name: Run S3 Versioning Stress Tests
  329. timeout-minutes: 30
  330. working-directory: test/s3/versioning
  331. run: |
  332. set -x
  333. echo "=== System Information ==="
  334. uname -a
  335. free -h
  336. # Run stress tests (concurrent operations)
  337. make test-versioning-stress || {
  338. echo "❌ Stress test failed, checking logs..."
  339. if [ -f weed-test.log ]; then
  340. echo "=== Server logs ==="
  341. tail -200 weed-test.log
  342. fi
  343. make clean
  344. exit 1
  345. }
  346. make clean
  347. - name: Upload stress test logs
  348. if: always()
  349. uses: actions/upload-artifact@v4
  350. with:
  351. name: s3-versioning-stress-logs
  352. path: test/s3/versioning/weed-test*.log
  353. retention-days: 7
  354. # Removed SSE-C integration tests and compatibility job