Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-06-30 19:44:28 +0300
committerGitHub <noreply@github.com>2022-06-30 19:44:28 +0300
commit6ca1d01a5df706ffffcc448d228a8d5061b081b1 (patch)
treeac763850a5448b9d880090b0453389366d66ad74
parentf936644bec370ecc9897681177f392291ea91375 (diff)
parentd6e35dfe2cb792d13fc25a8d527369143fea4a6e (diff)
Merge pull request #33075 from nextcloud/performance-ci
Run performance testing in CI
-rw-r--r--.github/workflows/performance.yml101
-rw-r--r--tests/blueprints/basic.toml20
2 files changed, 121 insertions, 0 deletions
diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml
new file mode 100644
index 00000000000..e5cbac5fe8f
--- /dev/null
+++ b/.github/workflows/performance.yml
@@ -0,0 +1,101 @@
+name: Performance testing
+on:
+ pull_request:
+
+jobs:
+ performance-testing:
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ php-versions: ['8.0']
+
+ name: performance-${{ matrix.php-versions }}
+
+ steps:
+ - name: Checkout server before PR
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+ ref: ${{ github.event.pull_request.base.ref }}
+
+ - name: Set up php ${{ matrix.php-versions }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-versions }}
+ tools: phpunit
+ extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
+
+ - name: Set up Nextcloud
+ run: |
+ mkdir data
+ ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
+
+ php -S localhost:8080 &
+ - name: Apply blueprint
+ uses: icewind1991/blueprint@v0.1.2
+ with:
+ blueprint: tests/blueprints/basic.toml
+ ref: ${{ github.event.pull_request.head.ref }}
+ - name: Run before measurements
+ uses: nextcloud/profiler@fa03a1e6864fcb63fb92b8940fa72f5191baffbe
+ with:
+ run: |
+ curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test
+ curl -s -u test:test http://localhost:8080/remote.php/dav/files/test/test.txt
+ curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test/many_files
+ curl -s -u test:test -T README.md http://localhost:8080/remote.php/dav/files/test/new_file.txt
+ curl -s -u test:test -X DELETE http://localhost:8080/remote.php/dav/files/test/new_file.txt
+ output: before.json
+
+ - name: Apply PR
+ run: |
+ git fetch origin ${{ github.event.pull_request.head.ref }}
+ git checkout ${{ github.event.pull_request.head.ref }}
+ git submodule update
+
+ ./occ upgrade
+
+ - name: Run after measurements
+ id: compare
+ uses: nextcloud/profiler@fa03a1e6864fcb63fb92b8940fa72f5191baffbe
+ with:
+ run: |
+ curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test
+ curl -s -u test:test http://localhost:8080/remote.php/dav/files/test/test.txt
+ curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test/many_files
+ curl -s -u test:test -T README.md http://localhost:8080/remote.php/dav/files/test/new_file.txt
+ curl -s -u test:test -X DELETE http://localhost:8080/remote.php/dav/files/test/new_file.txt
+ output: after.json
+ compare-with: before.json
+
+ - name: Upload profiles
+ if: always()
+ uses: actions/upload-artifact@v2
+ with:
+ name: profiles
+ path: |
+ before.json
+ after.json
+
+ - uses: actions/github-script@v5
+ if: failure() && steps.compare.outcome == 'failure'
+ with:
+ github-token: ${{secrets.GITHUB_TOKEN}}
+ script: |
+ let comment = `Possible performance regression detected\n`;
+ comment += `<details><summary>Show Output</summary>
+
+ \`\`\`
+ ${{ steps.compare.outputs.compare }}
+ \`\`\`
+
+ </details>`;
+
+ github.rest.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: comment
+ })
diff --git a/tests/blueprints/basic.toml b/tests/blueprints/basic.toml
new file mode 100644
index 00000000000..28902fd5708
--- /dev/null
+++ b/tests/blueprints/basic.toml
@@ -0,0 +1,20 @@
+[[user]]
+id = "test"
+groups = ["test_group"]
+files = [
+ "test.txt",
+ "foo/sub.png",
+ "empty",
+]
+
+[[user]]
+id = "test2"
+groups = ["test"]
+files = [
+ "many_files/file_[1..100].txt"
+]
+
+[[share]]
+from = "test2"
+to = "test"
+file = "many_files"