Skip to content

Commit

Permalink
Update hostnames for tests
Browse files Browse the repository at this point in the history
Use Devconf settings in the parameters.yml.dist, so devconf will work
out-of-the-box for development. Also remove the old StepupDeploy VM
parameters.yml. And update the readme to reflect the use of devconf.
  • Loading branch information
pablothedude committed Jan 9, 2025
1 parent 8ff61d1 commit 31d1cdb
Show file tree
Hide file tree
Showing 30 changed files with 114 additions and 172 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: |
cd docker &&
${DOCKER_COMPOSE} up -d --build &&
docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
docker compose exec -T --user www-data php-fpm.dev.openconext.org bash -c '
SYMFONY_ENV=ci composer install --prefer-dist -n -o --ignore-platform-reqs && \
./app/console cache:clear --env=ci && \
cd theme && CYPRESS_INSTALL_BINARY=0 yarn install --frozen-lockfile && EB_THEME=skeune yarn build
Expand All @@ -38,13 +38,13 @@ jobs:
if: always()
run: |
cd docker && \
docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
docker compose exec -T --user www-data php-fpm.dev.openconext.org bash -c '
EB_THEME=skeune ./theme/scripts/prepare-test.js
' && \
docker compose exec -T cypress bash -c '
cd e2e && yarn install && cypress run --spec cypress/integration/skeune/**/*.spec.js,cypress/integration/shared/*.spec.js --browser=chrome --headless
' && \
docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
docker compose exec -T --user www-data php-fpm.dev.openconext.org bash -c '
EB_THEME=openconext ./theme/scripts/prepare-test.js
' && \
docker compose exec -T cypress bash -c '
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
run: |
cd docker &&
${DOCKER_COMPOSE} up -d --build &&
docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
docker compose exec -T --user www-data php-fpm.dev.openconext.org bash -c '
SYMFONY_ENV=ci composer install --prefer-dist -n -o --ignore-platform-reqs && \
./app/console cache:clear --env=ci && \
cd theme && CYPRESS_INSTALL_BINARY=0 yarn install --frozen-lockfile && EB_THEME=skeune yarn build
'
- name: Run code quality tests
if: always()
run: |
cd docker && docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
cd docker && docker compose exec -T --user www-data php-fpm.dev.openconext.org bash -c '
echo -e "\nPHP Mess Detector\n" && \
./vendor/bin/phpmd src text ci/qa-config/phpmd.xml --exclude */Tests/* && \
echo -e "\nPHP CodeSniffer\n" && \
Expand All @@ -52,7 +52,7 @@ jobs:
- name: Run unit tests
if: always()
run: |
cd docker && APP_ENV=ci docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
cd docker && APP_ENV=ci SYMFONY_ENV=ci docker compose exec -T --user www-data php-fpm.dev.openconext.org bash -c '
echo -e "\nInstalling database fixtures...\n" && \
./app/console doctrine:schema:drop --force --env=ci && \
./app/console doctrine:schema:create --env=ci && \
Expand All @@ -70,7 +70,7 @@ jobs:
- name: Run acceptance tests
if: always()
run: |
cd docker && docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
cd docker && docker compose exec -T --user www-data php-fpm.dev.openconext.org bash -c '
echo -e "\nInstalling database fixtures...\n" && \
./app/console doctrine:schema:drop --force --env=ci && \
./app/console doctrine:schema:create --env=ci && \
Expand All @@ -86,7 +86,7 @@ jobs:
- name: Run linting tests
if: always()
run: |
cd docker && docker compose exec -T --user www-data php-fpm.vm.openconext.org bash -c '
cd docker && docker compose exec -T --user www-data php-fpm.dev.openconext.org bash -c '
echo -e "\nTwig lint\n" && \
app/console lint:twig theme/ && \
cd theme && \
Expand All @@ -98,7 +98,7 @@ jobs:
- name: Show log on failure
if: failure()
run: |
cd docker && docker compose exec -T php-fpm.vm.openconext.org cat /opt/openconext/OpenConext-engineblock/app/logs/ci/ci.log
cd docker && docker compose exec -T php-fpm.dev.openconext.org cat /opt/openconext/OpenConext-engineblock/app/logs/ci/ci.log
- name: Send notification on production build nightly build failure
uses: sonots/slack-notice-action@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions app/config/config_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ doctrine:
driver: pdo_mysql # This must be PDO until all database interaction runs through doctrine
server_version: 5.5
dbname: "%database.dbname%"
host: "db.vm.openconext.org"
host: "db.dev.openconext.org"
port: "%database.port%"
user: "%database.user%"
password: "%database.password%"
engineblock_test:
driver: pdo_mysql # This must be PDO until all database interaction runs through doctrine
server_version: 5.5
dbname: "%database.test.dbname%"
host: "db-test.vm.openconext.org"
host: "db-test.dev.openconext.org"
port: "%database.test.port%"
user: "%database.test.user%"
password: "%database.test.password%"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"source": "https://github.com/OpenConext/OpenConext-engineblock"
},
"require": {
"php": "7.2",
"php": "~7.2",
"ext-dom": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-php72.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '2.4'

services:
php-fpm.vm.openconext.org:
php-fpm.dev.openconext.org:
build:
dockerfile: docker/php-fpm/Dockerfile-php72
2 changes: 1 addition & 1 deletion docker/docker-compose-php82.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '2.4'

services:
php-fpm.vm.openconext.org:
php-fpm.dev.openconext.org:
build:
dockerfile: docker/php-fpm/Dockerfile-php82
22 changes: 11 additions & 11 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2.4'

services:

db.vm.openconext.org:
db.dev.openconext.local:
image: mariadb:10.2
restart: always
container_name: eb-db
Expand All @@ -19,7 +19,7 @@ services:
timeout: 2s
retries: 20

db-test.vm.openconext.org:
db-test.dev.openconext.local:
image: mariadb:10.2
restart: always
container_name: eb-db-test
Expand All @@ -37,32 +37,32 @@ services:
retries: 20
interval: 2s

php-fpm.vm.openconext.org:
php-fpm.dev.openconext.local:
build:
context: ../
# override this in a dedicated dockerfile per php version
# dockerfile: docker/php-fpm/Dockerfile
container_name: eb-phpfpm
volumes:
- ../:/opt/openconext/OpenConext-engineblock
- ../ci/qa-config/files/engine.vm.openconext.org.crt:/etc/apache2/ssl/engine.vm.openconext.org.crt
- ../ci/qa-config/files/engine.vm.openconext.org.key:/etc/apache2/ssl/engine.vm.openconext.org.key
- ../ci/qa-config/files/engine.dev.openconext.local.crt:/etc/apache2/ssl/engine.dev.openconext.local.crt
- ../ci/qa-config/files/engine.dev.openconext.local.key:/etc/apache2/ssl/engine.dev.openconext.local.key
depends_on:
db.vm.openconext.org:
db.dev.openconext.local:
condition: service_healthy
db-test.vm.openconext.org:
db-test.dev.openconext.local:
condition: service_healthy
extra_hosts:
- 'engine.vm.openconext.org: 127.0.0.1'
- 'engine.dev.openconext.local: 127.0.0.1'
environment:
APP_ENV: ci
SYMFONY_ENV: ci
networks:
default:
aliases:
- engine.vm.openconext.org
- engine.dev.openconext.local

selenium.vm.openconext.org:
selenium.dev.openconext.local:
image: selenium/standalone-chrome:2.53.1
container_name: eb-selenium
user: "${UID}:${GID}"
Expand All @@ -79,7 +79,7 @@ services:
cypress:
image: "cypress/included:13.1.0"
environment:
- CYPRESS_baseUrl=https://engine.vm.openconext.org
- CYPRESS_baseUrl=https://engine.dev.openconext.local
working_dir: /e2e
entrypoint: cypress open --project .
volumes:
Expand Down
58 changes: 0 additions & 58 deletions docker/nginx/nginx.conf

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getEncryptionKeysConfiguration()
$basePath = $this->container->getParameter('kernel.project_dir');
return [
'default' => [
'publicFile' => '/etc/openconext/engineblock.crt',
'publicFile' => '/config/engine/engineblock.crt',
'privateFile' => $basePath . '/ci/qa-config/files/engineblock.pem',
],
];
Expand Down
2 changes: 1 addition & 1 deletion library/EngineBlock/Application/TestDiContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function getEncryptionKeysConfiguration()

return [
'default' => [
'publicFile' => '/etc/openconext/engineblock.crt',
'publicFile' => '/config/engine/engineblock.crt',
'privateFile' => $basePath . '/ci/qa-config/files/engineblock.pem',
],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ Feature:
And I select "Dummy-IdP" on the WAYF
And I pass through EngineBlock
And I pass through the IdP
Then I should not see "https://engine.vm.openconext.org/authentication/idp/single-sign-on"
Then I should not see "https://engine.dev.openconext.org/authentication/idp/single-sign-on"
When I give my consent
And I pass through EngineBlock
Then the url should match "functional-testing/SP-with-Attribute-Manipulations/acs"
And the response should match xpath '/samlp:Response/saml:Assertion/saml:AttributeStatement/saml:Attribute[@Name="urn:mace:dir:attribute-def:uid"]/saml:AttributeValue[text()="https://engine.vm.openconext.org/authentication/idp/single-sign-on"]'
And the response should match xpath '/samlp:Response/saml:Assertion/saml:AttributeStatement/saml:Attribute[@Name="urn:mace:dir:attribute-def:uid"]/saml:AttributeValue[text()="https://engine.dev.openconext.org/authentication/idp/single-sign-on"]'

Scenario: The manipulation reduces a multivalued attribute to a single value
Given the IdP "Dummy-IdP" sends attribute "urn:mace:dir:attribute-def:eduPersonAffiliation" with values "student,faculty,guest,member" and xsi:type is "xs:string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Feature:
When I log in at "Dummy SP"
And I pass through EngineBlock
Then I should see "HTTP Method not allowed"
And I should see "The HTTP method \"GET\" is not allowed for location \"https://engine.vm.openconext.org/authentication/sp/consume-assertion\". Supported methods are: POST."
And I should see "The HTTP method \"GET\" is not allowed for location \"https://engine.dev.openconext.org/authentication/sp/consume-assertion\". Supported methods are: POST."

Scenario: An Identity Provider sends a response without a SHO
Given the IdP does not send the attribute named "urn:mace:terena.org:attribute-def:schacHomeOrganization"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature:
And I pass through the IdP
Then I should see "Identity Provider"
And I should see "Entity ID"
And I should see "https://engine.vm.openconext.org/functional-testing/Second-IdP/metadata"
And I should see "https://engine.dev.openconext.org/functional-testing/Second-IdP/metadata"
And I should see "Naam"
And I should see "Second-IdP"
And I should see "Logo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature:
Scenario: EngineBlock accepts RSA Encrypted Responses
Given the SP uses the HTTP POST Binding
And feature "eb.encrypted_assertions" is enabled
And the IdP encrypts its assertions with the public key in "/etc/openconext/engineblock.crt"
And the IdP encrypts its assertions with the public key in "/config/engine/engineblock.crt"
When I log in at "Dummy SP"
And I pass through the SP
And I pass through EngineBlock
Expand Down
Loading

0 comments on commit 31d1cdb

Please sign in to comment.