Skip to content

Commit bfcae0a

Browse files
committed
fix(tests)
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent ca7f1f4 commit bfcae0a

1 file changed

Lines changed: 37 additions & 19 deletions

File tree

.github/workflows/integration-test.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -785,23 +785,24 @@ jobs:
785785
echo "$OUT2" | grep -q "If all of these points are met, we give a Green label." || exit 1
786786
echo "$OUT3" | grep -q "overview.rst" || exit 1
787787
788-
- name: Remove some files using ${{ matrix.file-deletion-method }}
788+
- name: Remove some files using occ
789789
if: ${{ matrix.file-deletion-method == 'occ'}}
790790
run: |
791791
./occ files:delete admin/files/admin_manual
792792
793-
- name: Remove some files using ${{ matrix.file-deletion-method }}
793+
- name: Remove some files using os
794794
if: ${{ matrix.file-deletion-method == 'os'}}
795795
run: |
796796
cd data/admin/files
797797
rm -rf ./admin_manual # this + files:scan sadly doesn't work, currently see https://github.com/nextcloud/context_chat/issues/153
798+
cd ../../..
798799
./occ files:scan admin # We run the scan again to check if the files are successfully removed from the vectordb
799800
800801
- name: Share some files
801802
run: |
802803
OC_PASS=test ./occ user:add --password-from-env -- test
803804
# share developer_manual to test user
804-
curl -X POST -u 'admin:admin' -H 'OCS-APIRequest: true' 'http://localhost:8080/ocs/v2.php/apps/files_sharing/api/v1/shares?shareType=0&shareWith=test&path=developer_manual'
805+
curl -X POST -u 'admin:password' -H 'OCS-APIRequest: true' 'http://localhost:8080/ocs/v2.php/apps/files_sharing/api/v1/shares?shareType=0&shareWith=test&path=developer_manual'
805806
806807
- name: Run indexer cron
807808
run: |
@@ -815,24 +816,41 @@ jobs:
815816
run: |
816817
./occ background-job:worker 'OC\TaskProcessing\SynchronousBackgroundJob' &
817818
./occ background-job:worker 'OC\TaskProcessing\SynchronousBackgroundJob' &
818-
OUT1=$(./occ context_chat:prompt admin "Which factors are taken into account for the Ethical AI Rating?")
819-
OUT2=$(./occ context_chat:prompt admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
820-
OUT3=$(./occ context_chat:search admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
821-
echo "$OUT1" | 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
822-
echo "$OUT2" | 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
823-
echo "$OUT3" | grep -q -v "overview.rst" && echo 'Admin does not see AI overview anymore, when using search' || exit 1
819+
# Check for user admin: Should be there
820+
OUT_ADMIN_ENGLISH_PROMPT_AI=$(./occ context_chat:prompt admin "Which factors are taken into account for the Ethical AI Rating?")
821+
OUT_ADMIN_ENGLISH_PROMPT_AI=$(./occ context_chat:prompt admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
822+
OUT_ADMIN_SEARCH_AI=$(./occ context_chat:search admin "Welche Faktoren beeinflussen das Ethical AI Rating?")
823+
824+
# Check for user test: Shouldn't be there
825+
OUT_TEST_ENGLISH_PROMPT_AI=$(./occ context_chat:prompt test "Which factors are taken into account for the Ethical AI Rating?")
826+
OUT_TEST_GERMAN_PROMPT_AI=$(./occ context_chat:prompt test "Welche Faktoren beeinflussen das Ethical AI Rating?")
827+
OUT_TEST_SEARCH_AI=$(./occ context_chat:search test "Welche Faktoren beeinflussen das Ethical AI Rating?")
828+
829+
# Check for user test: Should be there, because it was shared
830+
OUT_TEST_PROMPT_JOBS=$(./occ context_chat:prompt test "How do I set my TimedJob to be time insensitive?")
831+
OUT_TEST_SEARCH_JOBS=$(./occ context_chat:search test "How do I set my TimedJob to be time insensitive?")
832+
833+
set -x
834+
835+
echo "$OUT_ADMIN_ENGLISH_PROMPT_AI"
836+
echo "$OUT_ADMIN_ENGLISH_PROMPT_AI"
837+
echo "$OUT_ADMIN_SEARCH_AI"
838+
echo "$OUT_TEST_ENGLISH_PROMPT_AI"
839+
echo "$OUT_TEST_GERMAN_PROMPT_AI"
840+
echo "$OUT_TEST_SEARCH_AI"
841+
echo "$OUT_TEST_PROMPT_JOBS"
842+
echo "$OUT_TEST_SEARCH_JOBS"
824843
825-
OUT1=$(./occ context_chat:prompt test "Which factors are taken into account for the Ethical AI Rating?")
826-
OUT2=$(./occ context_chat:prompt test "Welche Faktoren beeinflussen das Ethical AI Rating?")
827-
OUT3=$(./occ context_chat:search test "Welche Faktoren beeinflussen das Ethical AI Rating?")
828-
echo "$OUT1" | grep -q -v "If all of these points are met, we give a Green label." && echo 'Test user does not see AI overview' || exit 1
829-
echo "$OUT2" | grep -q -v "If all of these points are met, we give a Green label." && echo 'Test user does not see AI overview, after german question' || exit 1
830-
echo "$OUT3" | grep -q -v "overview.rst" && echo 'Test user does not see AI overview' || exit 1
844+
set +x
831845
832-
OUT1=$(./occ context_chat:prompt test "How do I set my TimedJob to be time insensitive?")
833-
OUT3=$(./occ context_chat:search test "How do I set my TimedJob to be time insensitive?")
834-
echo "$OUT1" | grep -q "This allows the Nextcloud to delay the job until a given nightly time window" && echo 'Test user does see BackgroundJobs docs' || exit 1
835-
echo "$OUT3" | grep -q "backgroundjobs.rst" && echo 'Test user does see BackgroundJobs docs' || exit 1
846+
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
847+
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, after german question' || exit 1
848+
echo "$OUT_ADMIN_SEARCH_AI" | grep -q -v "overview.rst" && echo 'Admin does not see AI overview anymore, when using search' || exit 1
849+
echo "$OUT_TEST_ENGLISH_PROMPT_AI" | grep -q -v "If all of these points are met, we give a Green label." && echo 'Test user does not see AI overview' || exit 1
850+
echo "$OUT_TEST_GERMAN_PROMPT_AI" | grep -q -v "If all of these points are met, we give a Green label." && echo 'Test user does not see AI overview, after german question' || exit 1
851+
echo "$OUT_TEST_SEARCH_AI" | grep -q -v "overview.rst" && echo 'Test user does not see AI overview, when using search' || exit 1
852+
echo "$OUT_TEST_PROMPT_JOBS" | grep -q "This allows the Nextcloud to delay the job until a given nightly time window" && echo 'Test user does see BackgroundJobs docs' || exit 1
853+
echo "$OUT_TEST_SEARCH_JOBS" | grep -q "backgroundjobs.rst" && echo 'Test user does see BackgroundJobs docs' || exit 1
836854
837855
- name: Show nextcloud logs
838856
if: always()

0 commit comments

Comments
 (0)