Skip to content

Commit

Permalink
ci(fix): resolve test failures in CI/CD pipeline
Browse files Browse the repository at this point in the history
- Fix path to isql command in database initialization scripts
- Add SPARQL_UPDATE role assignments to SPARQL account
- Set permissions for 'nobody' user in both dataset and provenance databases
- Update both bash and PowerShell scripts for cross-platform compatibility

This resolves the test failures in the GitHub CI/CD pipeline by ensuring
proper database permissions and access for test operations.
  • Loading branch information
arcangelo7 committed Feb 27, 2025
1 parent d406748 commit 77ae21a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Start-TestDatabases.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,21 @@ docker run -d --name test-provenance-db `
Write-Host "Waiting for test databases to start..."
Start-Sleep -Seconds 30
Write-Host "Test databases should be ready now."

# Set permissions for the 'nobody' user in both databases
Write-Host "Setting permissions for the 'nobody' user in the dataset database..."
docker exec test-dataset-db /opt/virtuoso-opensource/bin/isql -U dba -P dba exec="DB.DBA.RDF_DEFAULT_USER_PERMS_SET ('nobody', 7);"

Write-Host "Setting permissions for the 'nobody' user in the provenance database..."
docker exec test-provenance-db /opt/virtuoso-opensource/bin/isql -U dba -P dba exec="DB.DBA.RDF_DEFAULT_USER_PERMS_SET ('nobody', 7);"

# Assign SPARQL_SELECT and SPARQL_UPDATE roles to the SPARQL account
Write-Host "Assigning SPARQL_SELECT and SPARQL_UPDATE roles to the SPARQL account in the dataset database..."
docker exec test-dataset-db /opt/virtuoso-opensource/bin/isql -U dba -P dba exec="DB.DBA.USER_GRANT_ROLE ('SPARQL', 'SPARQL_UPDATE');"

Write-Host "Assigning SPARQL_SELECT and SPARQL_UPDATE roles to the SPARQL account in the provenance database..."
docker exec test-provenance-db /opt/virtuoso-opensource/bin/isql -U dba -P dba exec="DB.DBA.USER_GRANT_ROLE ('SPARQL', 'SPARQL_UPDATE');"

Write-Host "Permissions set successfully."
Write-Host "Dataset DB: http://localhost:9999/sparql"
Write-Host "Provenance DB: http://localhost:9998/sparql"
16 changes: 16 additions & 0 deletions tests/start-test-databases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,21 @@ docker run -d --name test-provenance-db \
echo "Waiting for test databases to start..."
sleep 30
echo "Test databases should be ready now."

# Set permissions for the 'nobody' user in both databases
echo "Setting permissions for the 'nobody' user in the dataset database..."
docker exec test-dataset-db /opt/virtuoso-opensource/bin/isql -U dba -P dba exec="DB.DBA.RDF_DEFAULT_USER_PERMS_SET ('nobody', 7);"

echo "Setting permissions for the 'nobody' user in the provenance database..."
docker exec test-provenance-db /opt/virtuoso-opensource/bin/isql -U dba -P dba exec="DB.DBA.RDF_DEFAULT_USER_PERMS_SET ('nobody', 7);"

# Assign SPARQL_SELECT and SPARQL_UPDATE roles to the SPARQL account
echo "Assigning SPARQL_SELECT and SPARQL_UPDATE roles to the SPARQL account in the dataset database..."
docker exec test-dataset-db /opt/virtuoso-opensource/bin/isql -U dba -P dba exec="DB.DBA.USER_GRANT_ROLE ('SPARQL', 'SPARQL_UPDATE');"

echo "Assigning SPARQL_SELECT and SPARQL_UPDATE roles to the SPARQL account in the provenance database..."
docker exec test-provenance-db /opt/virtuoso-opensource/bin/isql -U dba -P dba exec="DB.DBA.USER_GRANT_ROLE ('SPARQL', 'SPARQL_UPDATE');"

echo "Permissions set successfully."
echo "Dataset DB: http://localhost:9999/sparql"
echo "Provenance DB: http://localhost:9998/sparql"
2 changes: 2 additions & 0 deletions tests/test_dataset_db/virtuoso.log
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@
17:02:31 Checkpoint finished, log reused
18:02:32 Checkpoint started
18:02:32 Checkpoint finished, log reused
19:02:33 Checkpoint started
19:02:33 Checkpoint finished, log reused
Binary file modified tests/test_dataset_db/virtuoso.trx
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/test_provenance_db/virtuoso.log
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@
17:02:34 Checkpoint finished, log reused
18:02:34 Checkpoint started
18:02:34 Checkpoint finished, log reused
19:02:35 Checkpoint started
19:02:35 Checkpoint finished, log reused
Binary file modified tests/test_provenance_db/virtuoso.trx
Binary file not shown.

0 comments on commit 77ae21a

Please sign in to comment.