Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding integration tests #34

Merged
merged 30 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
06c75fb
adding the install script
unglaublicherdude Jun 6, 2024
b124df9
add the lockfiles and fix node_modules path
unglaublicherdude Jun 6, 2024
8aec9f7
use npm ci when package-lock exists
unglaublicherdude Jun 6, 2024
5274381
fix npm ci condition
unglaublicherdude Jun 6, 2024
fb482ec
fix nested if
unglaublicherdude Jun 6, 2024
883decc
remove the tty flag
unglaublicherdude Jun 6, 2024
d32d6fc
add constraint to artifact upload
unglaublicherdude Jun 6, 2024
e794752
add 2 simple upload tests
unglaublicherdude Jun 6, 2024
4300593
add tests for clean upload
unglaublicherdude Jun 7, 2024
7894d55
add pup tests and a test for vaas not working
unglaublicherdude Jun 7, 2024
2d7f843
add the status code to the status code check
unglaublicherdude Jun 7, 2024
1d1f96a
renamed the tests
unglaublicherdude Jun 7, 2024
041b2bf
some improvments to the install-script
unglaublicherdude Jun 10, 2024
95bb0d0
run most test in bats
unglaublicherdude Jun 10, 2024
9c8b381
make tests run in parallel (atleast somewhat)
unglaublicherdude Jun 11, 2024
15367e1
make tests more robust
unglaublicherdude Jun 11, 2024
49b1da4
try to make them more rubust
unglaublicherdude Jun 11, 2024
e1e70d8
actually make parallelism work
unglaublicherdude Jun 11, 2024
6e67083
add some more variables
unglaublicherdude Jun 11, 2024
1f1638d
remove trailing /
unglaublicherdude Jun 11, 2024
2efc873
adds commands for tagging and scanning
unglaublicherdude Jun 11, 2024
a6bfdee
remove condition from step
unglaublicherdude Jun 11, 2024
a35a679
with this, the php-cs-fixer runs on save (when useing the devcontainer)
Jun 12, 2024
66a7d75
refactor extracting shared code into services
Jun 12, 2024
d231b97
don't redefine the APP_ID in all files
Jun 12, 2024
2865348
make the install script faster by running nextcloud-installation and …
Jun 12, 2024
bf77edd
reduce parallelism
unglaublicherdude Jun 12, 2024
eb6101f
remove testfile
unglaublicherdude Jun 12, 2024
255bd0c
go back to nextcloud:28
unglaublicherdude Jun 12, 2024
da4c87b
remove user output
unglaublicherdude Jun 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "make build && composer install",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "lts",
"nvmVersion": "latest"
}
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/edouard-lopez/devcontainer-features/bats:0": {}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
Expand Down
71 changes: 35 additions & 36 deletions .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,50 @@ on:
branches: ["main"]

jobs:
# test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# name: setup node
# with:
# node-version: 20
# - name: Setup BATS
# uses: mig4/setup-bats@v1
# with:
# bats-version: 1.11.0
# - uses: docker-practice/actions-setup-docker@master
# - name: install nextcloud
# env:
# CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }}
# CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
# run: ./install.sh
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
name: setup node
with:
node-version: 20

- name: Setup BATS
uses: mig4/setup-bats@v1
with:
bats-version: 1.11.0

- uses: docker-practice/actions-setup-docker@master
- name: install nextcloud
env:
CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
run: ./install.sh

# - name: run tests
# env:
# CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }}
# CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
# run: bats --no-parallelize-across-files --jobs 3 ./tests
- name: run tests
env:
CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
run: bats --no-parallelize-across-files --jobs 2 ./tests

# - uses: actions/upload-artifact@master
# with:
# name: build-dir
# path: build/
- uses: actions/upload-artifact@master
with:
name: build-dir
path: build/

release:
# needs:
# - test
needs:
- test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4

# - uses: actions/download-artifact@master
# with:
# name: build-dir
# path: build/

- name: Build for appstore
run: make appstore
- uses: actions/download-artifact@master
with:
name: build-dir
path: build/

- name: replace version
id: replace-version
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ dev-environment*/
js/
*.cache
.uuid
eicar.com.txt
tmp/
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"php-cs-fixer.executablePath": "/workspaces/nextcloud-gdata-antivirus/vendor/bin/php-cs-fixer",
"php-cs-fixer.onsave": true,
"php-cs-fixer.autoFixByBracket": true,
"php-cs-fixer.autoFixBySemicolon": true
"php-cs-fixer.autoFixBySemicolon": true,
"[php]": {
"editor.defaultFormatter": "junstyle.php-cs-fixer"
},
}
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,18 @@ endif
.PHONY: npm
npm:
ifeq (,$(wildcard $(CURDIR)/package.json))
npm install
ifeq (,$(wildcard $(CURDIR)/package-lock.json))
npm install --no-audit --progress=false
else
npm ci
endif
cd js && $(npm) run build
else
npm install
ifeq (,$(wildcard $(CURDIR)/package-lock.json))
npm install --no-audit --progress=false
else
npm ci
endif
npm run build
endif

Expand Down
4 changes: 4 additions & 0 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ If you have any questions about scanning, usage or similar, please feel free to
<admin-section>OCA\GDataVaas\Settings\VaasAdminSection</admin-section>
<admin>OCA\GDataVaas\Settings\VaasAdmin</admin>
</settings>
<commands>
<command>OCA\GDataVaas\Command\ScanCommand</command>
<command>OCA\GDataVaas\Command\TagUnscannedCommand</command>
</commands>
<dependencies>
<nextcloud min-version="27" max-version="28"/>
</dependencies>
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"require-dev": {
"nextcloud/ocp": "dev-stable28",
"psalm/phar": "^5.17.0",
"nextcloud/coding-standard": "^v1.1.1"
"nextcloud/coding-standard": "^v1.1.1",
"symfony/console": "^6.4"
},
"scripts": {
"lint": "find lib -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
Expand Down
Loading
Loading