Skip to content

Commit

Permalink
attempt to fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
  • Loading branch information
julien-nc committed Sep 12, 2024
1 parent 02265af commit bb63497
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
fail-fast: false
matrix:
php-versions: [ '8.1' ]
server-versions: [ 'master', 'stable29', 'stable28' ]
server-versions: [ 'stable30', 'stable29', 'stable28' ]

name: Integration test

Expand All @@ -42,7 +42,7 @@ jobs:
with:
path: server
repository: nextcloud/server
ref:
ref: ${{ matrix.server-versions }}

- name: Checkout app
uses: actions/checkout@v3
Expand Down Expand Up @@ -81,19 +81,23 @@ jobs:
working-directory: server/
env:
DROPBOX_CONFIG: ${{ secrets.DROPBOX_CONFIG }}
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
run: |
echo $DROPBOX_CONFIG > config.json
sudo apt install jq sqlite3
sqlite3 data/owncloud.db "INSERT INTO oc_preferences ( userid, appid, configkey, configvalue) VALUES ('admin', 'integration_dropbox', 'account_id', $(cat config.json | jq '.config.account_id'));"
sqlite3 data/owncloud.db "INSERT INTO oc_preferences ( userid, appid, configkey, configvalue) VALUES ('admin', 'integration_dropbox', 'token', $(cat config.json | jq '.config.token'));"
sqlite3 data/owncloud.db "INSERT INTO oc_preferences ( userid, appid, configkey, configvalue) VALUES ('admin', 'integration_dropbox', 'refresh_token', $(cat config.json | jq '.config.refresh_token'));"
sqlite3 data/owncloud.db "INSERT INTO oc_preferences ( userid, appid, configkey, configvalue) VALUES ('admin', 'integration_dropbox', 'importing_dropbox', '1');"
sqlite3 data/owncloud.db "INSERT INTO oc_appconfig ( appid, configkey, configvalue) VALUES ('integration_dropbox', 'client_id', '$OAUTH_CLIENT_ID');"
sqlite3 data/owncloud.db "INSERT INTO oc_appconfig ( appid, configkey, configvalue) VALUES ('integration_dropbox', 'client_secret', '$OAUTH_CLIENT_SECRET');"
- name: Run import
working-directory: server/
run: |
php occ integration_dropbox:start-import admin
for run in {1..10}; do php cron.php; done
for run in {1..10}; do php cron.php; sleep 5; done
- name: Check import result
working-directory: server/
Expand All @@ -108,10 +112,9 @@ jobs:
EOM
diff result.expected.txt result.txt
cat > du-sh.expected.txt <<- EOM
1.5G data/admin/files/Dropbox import/
1.6G data/admin/files/Dropbox import/
EOM
du -sh data/admin/files/Dropbox\ import/ | diff du-sh.expected.txt -
- name: Show log on failure
working-directory: server/
Expand Down
3 changes: 3 additions & 0 deletions lib/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public function submitAccessCode(string $code = ''): DataResponse {
if (isset($result['email'])) {
$this->config->setUserValue($this->userId, Application::APP_ID, 'email', $result['email']);
$data['email'] = $result['email'];
} elseif (isset($info['email'])) {

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.1, dev-master)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.1, dev-stable28)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.1, dev-stable29)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.0, dev-stable28)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.0, dev-stable29)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.2, dev-master)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.2, dev-stable28)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.2, dev-stable29)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.3, dev-master)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.3, dev-stable29)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)

Check failure on line 126 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.3, dev-stable28)

InvalidArrayOffset

lib/Controller/ConfigController.php:126:20: InvalidArrayOffset: Cannot access value on variable $info using offset value of 'email', expecting 'error' (see https://psalm.dev/115)
$this->config->setUserValue($this->userId, Application::APP_ID, 'email', $info['email']);
$data['email'] = $info['email'];
}
if (isset($info['name'], $info['name']['display_name'])) {
$this->config->setUserValue($this->userId, Application::APP_ID, 'user_name', $info['name']['display_name']);
Expand Down
2 changes: 2 additions & 0 deletions src/components/PersonalSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ export default {
methods: {
onLogoutClick() {
this.state.user_name = ''
this.state.email = null
this.state.account_id = null
this.saveOptions({ user_name: this.state.user_name })
},
onAccessCodeInput() {
Expand Down

0 comments on commit bb63497

Please sign in to comment.