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 699a37f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
11 changes: 7 additions & 4 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,13 +81,17 @@ 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/
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
2 changes: 1 addition & 1 deletion lib/Command/StartImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function configure() {
*/
protected function execute(InputInterface $input, OutputInterface $output): int {
try {
$this->dropboxStorageAPIService->importDropboxJob($input->getArgument('user_id'));
$this->dropboxStorageAPIService->startImportDropbox($input->getArgument('user_id'));
} catch (\Exception $ex) {
$output->writeln('<error>Failed to start import</error>');
$output->writeln($ex->getMessage());
Expand Down
4 changes: 4 additions & 0 deletions lib/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function setConfig(array $values): DataResponse {
$this->config->deleteUserValue($this->userId, Application::APP_ID, 'user_name');
$this->config->deleteUserValue($this->userId, Application::APP_ID, 'uid');
$this->config->deleteUserValue($this->userId, Application::APP_ID, 'account_id');
$this->config->deleteUserValue($this->userId, Application::APP_ID, 'email');
$this->config->deleteUserValue($this->userId, Application::APP_ID, 'token');
$this->config->deleteUserValue($this->userId, Application::APP_ID, 'refresh_token');
}
Expand Down Expand Up @@ -123,6 +124,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 127 in lib/Controller/ConfigController.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.1, dev-master)

InvalidArrayOffset

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

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

View workflow job for this annotation

GitHub Actions / Nextcloud (8.2, dev-stable29)

InvalidArrayOffset

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

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

View workflow job for this annotation

GitHub Actions / Nextcloud (8.3, dev-master)

InvalidArrayOffset

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

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

View workflow job for this annotation

GitHub Actions / Nextcloud (8.1, dev-stable29)

InvalidArrayOffset

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

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

View workflow job for this annotation

GitHub Actions / Nextcloud (8.1, dev-stable28)

InvalidArrayOffset

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

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

View workflow job for this annotation

GitHub Actions / Nextcloud (8.0, dev-stable29)

InvalidArrayOffset

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

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

View workflow job for this annotation

GitHub Actions / Nextcloud (8.2, dev-stable28)

InvalidArrayOffset

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

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

View workflow job for this annotation

GitHub Actions / Nextcloud (8.2, dev-master)

InvalidArrayOffset

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

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

View workflow job for this annotation

GitHub Actions / Nextcloud (8.3, dev-stable28)

InvalidArrayOffset

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

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

View workflow job for this annotation

GitHub Actions / Nextcloud (8.3, dev-stable29)

InvalidArrayOffset

lib/Controller/ConfigController.php:127: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 699a37f

Please sign in to comment.