Skip to content

Commit

Permalink
Test integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
melaniekung committed Feb 12, 2025
1 parent 9a39ea0 commit 3a4d011
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- qa/**
- stable/**
- dev/integration-test-test
jobs:
integration-tests:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -50,7 +51,7 @@ jobs:
run: sudo npm install -g npm && npm ci
- name: Modify Gearman config
run: |
echo -e "all:\n servers:\n default: 127.0.0.1:63005" \
sudo echo -e "all:\n servers:\n default: 127.0.0.1:4730" \
> apps/qubit/config/gearman.yml
- name: Build themes
run: |
Expand Down Expand Up @@ -107,14 +108,12 @@ jobs:
- name: Print logs
if: failure()
run: |
echo 'Print qubit_cli.log'
sudo tail ${{ github.workspace }}/log/qubit_cli.log
echo 'Print qubit_worker.log'
sudo tail ${{ github.workspace }}/log/qubit_worker.log
echo 'Print qubit_prod.log'
sudo tail ${{ github.workspace }}/log/qubit_prod.log
echo 'Print nginx/error.log'
sudo tail /var/log/nginx/error.log
sudo tail -n 30 /var/log/nginx/error.log
echo 'Print php8.3-fpm.log'
sudo tail /var/log/php8.3-fpm.log
- name: Upload Cypress Screenshots
Expand Down
64 changes: 61 additions & 3 deletions cypress/e2e/csv_import.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,67 @@ describe('CSV import', () => {
cy.login()

cy.visit('/object/importSelect?type=csv')
cy.get('input[name=file]').selectFile('cypress/fixtures/import_order.csv')
cy.get('input[type=submit]').click()
cy.get('input[name=file]').attachFile('import_order.csv')
cy.get('#wrapper form').submit()

cy.contains('Import file initiated')

cy.visit('/settings/treeview')
cy.get('input[name=type][value=fullWidth]').click()
cy.get('#wrapper form').submit()

cy.waitUntil(() =>
cy.visit('/informationobject/browse').then(() =>
Cypress.$('a:contains("CSV import order fonds")').length > 0
)
)

cy.contains('CSV import order fonds').click()
cy.waitUntil(() => Cypress.$('li.jstree-node').length === 4)
cy.get('li.jstree-closed > i')
.should('be.visible') // Ensure the element is visible
.click({ multiple: true });
cy.waitUntil(() => Cypress.$('li.jstree-node').length === 34)

const orderedTitles = [
'CSV import order fonds',
'Series A',
'SA Item 1',
'SA Item 2',
'SA Item 3',
'SA Item 4',
'SA Item 5',
'SA Item 6',
'SA Item 7',
'SA Item 8',
'SA Item 9',
'SA Item 10',
'SA Item 11',
'SA Item 12',
'SA Item 13',
'SA Item 14',
'SA Item 15',
'Series B',
'SB Item 1',
'SB Item 2',
'SB Item 3',
'SB Item 4',
'SB Item 5',
'SB Item 6',
'SB Item 7',
'SB Item 8',
'SB Item 9',
'SB Item 10',
'Series C',
'SC Item 1',
'SC Item 2',
'SC Item 3',
'SC Item 4',
'SC Item 5',
]

cy.get('li.jstree-node').each(($li, index) =>
cy.wrap($li).contains(orderedTitles[index])
)
})
})
})
75 changes: 75 additions & 0 deletions docker/docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
volumes:
elasticsearch_data:
percona_data:
composer_deps:
npm_deps:

services:

atom:
build: ..
env_file: etc/environment
environment:
- ATOM_COVERAGE=${ATOM_COVERAGE:-false}
volumes:
- composer_deps:/atom/src/vendor/composer
- npm_deps:/atom/src/node_modules
- ..:/atom/src:rw

atom_worker:
build: ..
command: worker
env_file: etc/environment
environment:
- ATOM_COVERAGE=${ATOM_COVERAGE:-false}
depends_on:
- gearmand
- percona
restart: on-failure:5
volumes:
- composer_deps:/atom/src/vendor/composer
- npm_deps:/atom/src/node_modules
- ..:/atom/src:rw

nginx:
image: nginx:latest
volumes:
- composer_deps:/atom/src/vendor/composer
- npm_deps:/atom/src/node_modules
- ..:/atom/src:ro
- ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "63001:80"

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.23
env_file: etc/environment
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
ports:
- "127.0.0.1:63002:9200"

percona:
image: percona:8.0
env_file: etc/environment
volumes:
- percona_data:/var/lib/mysql:rw
- ./etc/mysql/mysqld.cnf:/etc/my.cnf.d/mysqld.cnf:ro
ports:
- "127.0.0.1:63003:3306"

memcached:
image: memcached
command: -p 11211 -m 128 -u memcache
ports:
- "127.0.0.1:63004:11211"

gearmand:
image: artefactual/gearmand
ports:
- "127.0.0.1:4730:4730"
1 change: 1 addition & 0 deletions vendor/net_gearman/Net/Gearman/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class Net_Gearman_Client
*/
public function __construct($servers, $timeout = 1000)
{
prodlog('servers', $servers);
if (!is_array($servers) && strlen($servers) > 0) {
$servers = array($servers);
} elseif (is_array($servers) && !count($servers)) {
Expand Down

0 comments on commit 3a4d011

Please sign in to comment.