File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -186,3 +186,5 @@ cypress/snapshots
186186cypress /videos
187187
188188/.direnv
189+
190+ /.hypothesis /
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
4+ # SPDX-License-Identifier: AGPL-3.0-or-later
5+
6+ set -euo pipefail
7+
8+ user=" $1 "
9+ spec=" $2 "
10+
11+ python -m venv venv
12+ source venv/bin/activate
13+ pip install schemathesis==4.1.3
14+
15+ rm data config/config.php -rf
16+
17+ ./occ maintenance:install --admin-pass admin
18+ ./occ config:system:set auth.bruteforce.protection.enabled --value=false --type=boolean
19+
20+ if [[ " $user " != " admin" ]]; then
21+ ./occ app:disable password_policy
22+ NC_PASS=" $user " ./occ user:add " $user " --password-from-env
23+ fi
24+
25+ app_password=" $( echo " $user " | ./occ user:auth-tokens:add " $user " | tail -n 1) "
26+
27+ # Ensure enough workers will be available to handle all requests
28+ NEXTCLOUD_WORKERS=100 composer serve & > /dev/null &
29+ pid=$!
30+ function cleanup() {
31+ kill " $pid "
32+ }
33+ trap cleanup EXIT
34+
35+ until curl -s -o /dev/null http://localhost:8080/status.php; do sleep 1s; done
36+
37+ schemathesis run \
38+ " $spec " \
39+ --checks all \
40+ --exclude-checks missing_required_header,unsupported_method \
41+ --workers auto \
42+ --url http://localhost:8080 \
43+ -H " OCS-APIRequest: true" \
44+ -H " Accept: application/json" \
45+ -H " Authorization: Bearer $app_password "
You can’t perform that action at this time.
0 commit comments