Skip to content

Commit 796ffcf

Browse files
committed
just testing ci
1 parent f9cf8c7 commit 796ffcf

11 files changed

Lines changed: 57 additions & 454 deletions

File tree

.github/workflows/integration-test.yml

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
matrix:
3232
php-versions: [ '8.1' ]
3333
databases: [ 'pgsql' ]
34-
server-versions: [ 'stable30', 'stable31', 'master' ]
34+
server-versions: [ 'stable31', 'master' ]
3535
encryption: ['on', 'off']
3636
exclude:
3737
- server-versions: stable30
@@ -43,7 +43,7 @@ jobs:
4343
php-versions: 8.1
4444
encryption: on
4545

46-
name: Integration test ☁️${{ matrix.server-versions }} 🐘${{ matrix.php-versions }} 🔐:${{ matrix.encryption }}
46+
name: ☁️${{ matrix.server-versions }} 🐘${{ matrix.php-versions }} 🔐:${{ matrix.encryption }}
4747

4848
env:
4949
MYSQL_PORT: 4444
@@ -184,13 +184,13 @@ jobs:
184184
run: |
185185
cd data/admin/files
186186
LIMIT=100
187-
187+
188188
# Find all files in the directory and its subdirectories
189189
FILES=($(find papers/ -type f))
190-
190+
191191
# Count the number of files
192192
FILE_COUNT=${#FILES[@]}
193-
193+
194194
# Check if the current number of files exceeds the limit
195195
if [ "$FILE_COUNT" -le "$LIMIT" ]; then
196196
echo "No files need to be deleted. Current count: $FILE_COUNT"
@@ -199,7 +199,7 @@ jobs:
199199
200200
# Calculate how many files to delete
201201
FILES_TO_DELETE=$((FILE_COUNT - LIMIT))
202-
202+
203203
# Sort files by modification time (oldest first) and delete the oldest ones
204204
for FILE in $(ls -t "${FILES[@]}" | tail -n "$FILES_TO_DELETE"); do
205205
echo "Deleting: $FILE"
@@ -230,6 +230,12 @@ jobs:
230230
- name: Register backend
231231
run: |
232232
set -x
233+
234+
./occ config:app:set --value 30 --type integer context_chat indexing_job_interval # 30 seconds
235+
./occ config:app:set --value 10 --type integer context_chat crawl_job_interval # 10 seconds
236+
./occ config:app:set --value 10 --type integer context_chat action_job_interval # 10 seconds
237+
./occ config:app:set --value 10 --type integer context_chat fs_listener_job_interval # 10 seconds
238+
233239
./occ config:system:set debug --value true
234240
./occ config:system:set loglevel --value 0
235241
./occ app_api:daemon:register --net host manual_install "Manual Install" manual-install http localhost http://localhost:8080
@@ -337,7 +343,7 @@ jobs:
337343
matrix:
338344
php-versions: [ '8.1' ]
339345
databases: [ 'pgsql' ]
340-
server-versions: [ 'stable30', 'stable31', 'master' ]
346+
server-versions: [ 'stable31', 'master' ]
341347
encryption: ['on', 'off']
342348
exclude:
343349
- server-versions: stable30
@@ -349,7 +355,7 @@ jobs:
349355
php-versions: 8.1
350356
encryption: on
351357

352-
name: Integration test with cron ☁️${{ matrix.server-versions }} 🐘${{ matrix.php-versions }} 🔐:${{ matrix.encryption }}
358+
name: with cron ☁️${{ matrix.server-versions }} 🐘${{ matrix.php-versions }} 🔐:${{ matrix.encryption }}
353359

354360
env:
355361
MYSQL_PORT: 4444
@@ -518,13 +524,13 @@ jobs:
518524
run: |
519525
cd data/admin/files
520526
LIMIT=100
521-
527+
522528
# Find all files in the directory and its subdirectories
523529
FILES=($(find papers/ -type f))
524-
530+
525531
# Count the number of files
526532
FILE_COUNT=${#FILES[@]}
527-
533+
528534
# Check if the current number of files exceeds the limit
529535
if [ "$FILE_COUNT" -le "$LIMIT" ]; then
530536
echo "No files need to be deleted. Current count: $FILE_COUNT"
@@ -533,7 +539,7 @@ jobs:
533539
534540
# Calculate how many files to delete
535541
FILES_TO_DELETE=$((FILE_COUNT - LIMIT))
536-
542+
537543
# Sort files by modification time (oldest first) and delete the oldest ones
538544
for FILE in $(ls -t "${FILES[@]}" | tail -n "$FILES_TO_DELETE"); do
539545
echo "Deleting: $FILE"
@@ -556,7 +562,7 @@ jobs:
556562
./occ config:app:set --value 10 --type integer context_chat crawl_job_interval # 10 seconds
557563
./occ config:app:set --value 10 --type integer context_chat action_job_interval # 10 seconds
558564
./occ config:app:set --value 10 --type integer context_chat fs_listener_job_interval # 10 seconds
559-
for i in {1..100}; do
565+
for i in {1..100}; do
560566
php cron.php & # Starting with stable31 we can use -v here for better visibility
561567
wait
562568
./occ context_chat:stats
@@ -592,19 +598,19 @@ jobs:
592598
- name: Run the prompts
593599
run: |
594600
./occ background-job:worker --stop_after=2m 'OC\TaskProcessing\SynchronousBackgroundJob' &
595-
./occ background-job:worker --stop_after=2m 'OC\TaskProcessing\SynchronousBackgroundJob' &
596-
OUT1=$(./occ context_chat:prompt admin "Which factors are taken into account for the Ethical AI Rating?")
597-
echo "$OUT1"
598-
echo '--------------------------------------------------'
599-
OUT2=$(./occ context_chat:prompt admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
600-
echo "$OUT2"
601-
echo '--------------------------------------------------'
602-
603-
OUT3=$(./occ context_chat:search admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
604-
echo "$OUT3"
605-
echo "$OUT1" | grep -q "If all of these points are met, we give a Green label." || exit 1
606-
echo "$OUT2" | grep -q "If all of these points are met, we give a Green label." || exit 1
607-
echo "$OUT3" | grep -q "overview.rst" || exit 1
601+
# ./occ background-job:worker --stop_after=2m 'OC\TaskProcessing\SynchronousBackgroundJob' &
602+
# OUT1=$(./occ context_chat:prompt admin "Which factors are taken into account for the Ethical AI Rating?")
603+
# echo "$OUT1"
604+
# echo '--------------------------------------------------'
605+
# OUT2=$(./occ context_chat:prompt admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
606+
# echo "$OUT2"
607+
# echo '--------------------------------------------------'
608+
#
609+
# OUT3=$(./occ context_chat:search admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
610+
# echo "$OUT3"
611+
# echo "$OUT1" | grep -q "If all of these points are met, we give a Green label." || exit 1
612+
# echo "$OUT2" | grep -q "If all of these points are met, we give a Green label." || exit 1
613+
# echo "$OUT3" | grep -q "overview.rst" || exit 1
608614

609615
- name: Show nextcloud logs
610616
if: always()
@@ -633,7 +639,7 @@ jobs:
633639
matrix:
634640
php-versions: [ '8.1' ]
635641
databases: [ 'pgsql' ]
636-
server-versions: [ 'stable30', 'stable31', 'master' ]
642+
server-versions: [ 'stable31', 'master' ]
637643
encryption: ['on', 'off']
638644
file-deletion-method: [ 'occ', 'os' ]
639645
exclude:
@@ -659,7 +665,7 @@ jobs:
659665
encryption: off
660666

661667

662-
name: Integration test with file listener ☁️${{ matrix.server-versions }} 🐘${{ matrix.php-versions }} 🗑️${{ matrix.file-deletion-method }} 🔐:${{ matrix.encryption }}
668+
name: with listener ☁️${{ matrix.server-versions }} 🐘${{ matrix.php-versions }} 🗑️${{ matrix.file-deletion-method }} 🔐:${{ matrix.encryption }}
663669

664670
env:
665671
MYSQL_PORT: 4444
@@ -843,13 +849,13 @@ jobs:
843849
run: |
844850
cd data/admin/files
845851
LIMIT=100
846-
852+
847853
# Find all files in the directory and its subdirectories
848854
FILES=($(find papers/ -type f))
849-
855+
850856
# Count the number of files
851857
FILE_COUNT=${#FILES[@]}
852-
858+
853859
# Check if the current number of files exceeds the limit
854860
if [ "$FILE_COUNT" -le "$LIMIT" ]; then
855861
echo "No files need to be deleted. Current count: $FILE_COUNT"
@@ -858,7 +864,7 @@ jobs:
858864
859865
# Calculate how many files to delete
860866
FILES_TO_DELETE=$((FILE_COUNT - LIMIT))
861-
867+
862868
# Sort files by modification time (oldest first) and delete the oldest ones
863869
for FILE in $(ls -t "${FILES[@]}" | tail -n "$FILES_TO_DELETE"); do
864870
echo "Deleting: $FILE"
@@ -873,7 +879,7 @@ jobs:
873879
874880
- name: Run indexer cron
875881
run: |
876-
for i in {1..100}; do
882+
for i in {1..100}; do
877883
php cron.php & # Starting with stable31 we can use -v here for better visibility
878884
wait
879885
./occ context_chat:stats
@@ -911,21 +917,21 @@ jobs:
911917
./occ background-job:worker --stop_after=2m 'OC\TaskProcessing\SynchronousBackgroundJob' &
912918
./occ background-job:worker --stop_after=2m 'OC\TaskProcessing\SynchronousBackgroundJob' &
913919
set +e
914-
920+
915921
# Check for user admin: Should be there
916922
OUT_ADMIN_ENGLISH_PROMPT_AI=$(./occ context_chat:prompt admin "Which factors are taken into account for the Ethical AI Rating?")
917923
OUT_ADMIN_GERMAN_PROMPT_AI=$(./occ context_chat:prompt admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
918924
OUT_ADMIN_SEARCH_AI=$(./occ context_chat:search admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
919-
925+
920926
# Check for user test: Shouldn't be there
921927
OUT_TEST_ENGLISH_PROMPT_AI=$(./occ context_chat:prompt test "Which factors are taken into account for the Ethical AI Rating?")
922928
OUT_TEST_GERMAN_PROMPT_AI=$(./occ context_chat:prompt test "Welche Faktoren beeinflussen das Ethical AI Rating?")
923929
OUT_TEST_SEARCH_AI=$(./occ context_chat:search test "Welche Faktoren beeinflussen das Ethical AI Rating?")
924-
930+
925931
# Check for user test: Shouldn't be there, because it was not shared yet
926932
OUT_TEST_PROMPT_JOBS=$(./occ context_chat:prompt test "How do I set my TimedJob to be time insensitive?")
927933
OUT_TEST_SEARCH_JOBS=$(./occ context_chat:search test "How do I set my TimedJob to be time insensitive?")
928-
934+
929935
echo "OUT_ADMIN_ENGLISH_PROMPT_AI"
930936
echo "$OUT_ADMIN_ENGLISH_PROMPT_AI"
931937
echo "OUT_ADMIN_GERMAN_PROMPT_AI"
@@ -942,7 +948,7 @@ jobs:
942948
echo "$OUT_TEST_PROMPT_JOBS"
943949
echo "OUT_TEST_SEARCH_JOBS"
944950
echo "$OUT_TEST_SEARCH_JOBS"
945-
951+
946952
echo "$OUT_ADMIN_ENGLISH_PROMPT_AI" | grep -q "If all of these points are met, we give a Green label." && echo '✅ Admin does see AI overview' || exit 1
947953
echo "$OUT_ADMIN_GERMAN_PROMPT_AI" | grep -q "If all of these points are met, we give a Green label." && echo '✅ Admin does see AI overview, after german question' || exit 1
948954
echo "$OUT_ADMIN_SEARCH_AI" | grep -q "overview.rst" && echo '✅ Admin does see AI overview, when using search' || exit 1
@@ -960,7 +966,7 @@ jobs:
960966
- name: Remove some files using os
961967
if: ${{ matrix.file-deletion-method == 'os'}}
962968
run: |
963-
cd data/admin/files
969+
cd data/admin/files
964970
rm -rf ./admin_manual # this + files:scan sadly doesn't work, currently see https://github.com/nextcloud/context_chat/issues/153
965971
cd ../../..
966972
./occ files:scan admin # We run the scan again to check if the files are successfully removed from the vectordb
@@ -975,7 +981,7 @@ jobs:
975981
976982
- name: Run indexer cron
977983
run: |
978-
for i in {1..100}; do
984+
for i in {1..100}; do
979985
php cron.php & # Starting with stable31 we can use -v here for better visibility
980986
wait
981987
./occ context_chat:stats
@@ -985,23 +991,23 @@ jobs:
985991
run: |
986992
./occ background-job:worker --stop_after=2m 'OC\TaskProcessing\SynchronousBackgroundJob' &
987993
./occ background-job:worker --stop_after=2m 'OC\TaskProcessing\SynchronousBackgroundJob' &
988-
994+
989995
set +e
990-
996+
991997
# Check for user admin: Shouldn't be there
992998
OUT_ADMIN_ENGLISH_PROMPT_AI=$(./occ context_chat:prompt admin "Which factors are taken into account for the Ethical AI Rating?")
993999
OUT_ADMIN_GERMAN_PROMPT_AI=$(./occ context_chat:prompt admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
9941000
OUT_ADMIN_SEARCH_AI=$(./occ context_chat:search admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
995-
1001+
9961002
# Check for user test: Shouldn't be there
9971003
OUT_TEST_ENGLISH_PROMPT_AI=$(./occ context_chat:prompt test "Which factors are taken into account for the Ethical AI Rating?")
9981004
OUT_TEST_GERMAN_PROMPT_AI=$(./occ context_chat:prompt test "Welche Faktoren beeinflussen das Ethical AI Rating?")
9991005
OUT_TEST_SEARCH_AI=$(./occ context_chat:search test "Welche Faktoren beeinflussen das Ethical AI Rating?")
1000-
1006+
10011007
# Check for user test: Should be there, because it was shared
10021008
OUT_TEST_PROMPT_JOBS=$(./occ context_chat:prompt test "How do I set my TimedJob to be time insensitive?")
10031009
OUT_TEST_SEARCH_JOBS=$(./occ context_chat:search test "How do I set my TimedJob to be time insensitive?")
1004-
1010+
10051011
echo "OUT_ADMIN_ENGLISH_PROMPT_AI"
10061012
echo "$OUT_ADMIN_ENGLISH_PROMPT_AI"
10071013
echo "OUT_ADMIN_GERMAN_PROMPT_AI"
@@ -1018,7 +1024,7 @@ jobs:
10181024
echo "$OUT_TEST_PROMPT_JOBS"
10191025
echo "OUT_TEST_SEARCH_JOBS"
10201026
echo "$OUT_TEST_SEARCH_JOBS"
1021-
1027+
10221028
echo "$OUT_ADMIN_ENGLISH_PROMPT_AI" | grep -q -v "If all of these points are met, we give a Green label." && echo '✅ Admin does not see AI overview anymore' || exit 1
10231029
echo "$OUT_ADMIN_GERMAN_PROMPT_AI" | grep -q -v "If all of these points are met, we give a Green label." && echo '✅ Admin does not see AI overview anymore, after german question' || exit 1
10241030
echo "$OUT_ADMIN_SEARCH_AI" | grep -q -v "overview.rst" && echo '✅ Admin does not see AI overview anymore, when using search' || exit 1
@@ -1059,4 +1065,4 @@ jobs:
10591065

10601066
steps:
10611067
- name: Summary status
1062-
run: if ${{ needs.scan-test.rest != 'success' && needs.cron-test.result != 'success' && needs.listener-test.result != 'success' }}; then exit 1; fi
1068+
run: if ${{ needs.scan-test.rest != 'success' && needs.cron-test.result != 'success' && needs.listener-test.result != 'success' }}; then exit 1; fi

.github/workflows/lint-php-cs.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)