A third party ATProto appview
1#!/bin/bash
2
3# Run all API endpoint tests
4
5source "$(dirname "$0")/config.sh"
6
7echo "========================================"
8echo "Running All API Endpoint Tests"
9echo "========================================"
10echo ""
11echo "Instance: $BASE_URL"
12echo ""
13
14# Track results
15total_tests=0
16passed_tests=0
17failed_tests=0
18
19run_test_script() {
20 local script=$1
21 local script_name=$(basename "$script")
22
23 echo ""
24 echo "========================================"
25 echo "Running: $script_name"
26 echo "========================================"
27
28 bash "$script"
29 exit_code=$?
30
31 total_tests=$((total_tests + 1))
32 if [ $exit_code -eq 0 ]; then
33 passed_tests=$((passed_tests + 1))
34 else
35 failed_tests=$((failed_tests + 1))
36 fi
37}
38
39# Run all test scripts
40run_test_script "$(dirname "$0")/test-health.sh"
41run_test_script "$(dirname "$0")/test-system.sh"
42run_test_script "$(dirname "$0")/test-auth.sh"
43run_test_script "$(dirname "$0")/test-feed.sh"
44run_test_script "$(dirname "$0")/test-actor.sh"
45run_test_script "$(dirname "$0")/test-graph.sh"
46run_test_script "$(dirname "$0")/test-notifications.sh"
47run_test_script "$(dirname "$0")/test-video.sh"
48run_test_script "$(dirname "$0")/test-moderation.sh"
49run_test_script "$(dirname "$0")/test-labels.sh"
50run_test_script "$(dirname "$0")/test-settings.sh"
51run_test_script "$(dirname "$0")/test-posts.sh"
52
53# Print summary
54echo ""
55echo "========================================"
56echo "Test Summary"
57echo "========================================"
58echo "Total test suites: $total_tests"
59echo -e "${GREEN}Passed: $passed_tests${NC}"
60echo -e "${RED}Failed: $failed_tests${NC}"
61echo ""
62
63if [ $failed_tests -eq 0 ]; then
64 echo -e "${GREEN}All tests completed successfully!${NC}"
65 exit 0
66else
67 echo -e "${RED}Some tests failed. Check output above for details.${NC}"
68 exit 1
69fi