Skip to content

Commit

Permalink
fix integration test users, update readme, update version
Browse files Browse the repository at this point in the history
  • Loading branch information
Glutamat42 committed Jan 27, 2025
1 parent f40cb29 commit 6e92f11
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
This playbook configures a moodle instance with AdLer.

The following roles are available:
- test_users: Creates test users for manual use
- moodle_dev_env: For moodle development (don't install plugins)
- integration_test: For integration and end-to-end tests (activate mobile services, create test users for automated tests)

The following environment variables are used:
- DECLARATIVE_SETUP_MANAGER_PASSWORD: Password for the manager user (role: test_users)
- DECLARATIVE_SETUP_STUDENT_PASSWORD: Password for the student user (role: test_users)
- DECLERATIVE_SETUP_INTEGRATION_TEST_MANAGER_PASSWORD: Password for the integration test manager user (role: integration_test)
- DECLERATIVE_SETUP_INTEGRATION_TEST_STUDENT_PASSWORD: Password for the integration test student user (role: integration_test)
- *test_users*: Creates test users for manual use
- usernames: manager, student
- environment variables:
- DECLARATIVE_SETUP_MANAGER_PASSWORD: Password for the manager user
- DECLARATIVE_SETUP_STUDENT_PASSWORD: Password for the student user
- *moodle_dev_env*: For moodle development (don't install plugins)
- *integration_test*: For integration and end-to-end tests
- activate mobile services
- create test users for automated tests (integration_test_manager, integration_test_student)
- environment variables:
- DECLERATIVE_SETUP_INTEGRATION_TEST_MANAGER_PASSWORD: Password for the integration test manager user
- DECLERATIVE_SETUP_INTEGRATION_TEST_STUDENT_PASSWORD: Password for the integration test student user

## files/plugins.json
This file is required if `moodle_dev_env` role is not used. Get the current version from
Expand Down
4 changes: 2 additions & 2 deletions classes/playbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ protected function playbook_implementation(): void {
if ($this->has_role('integration_test')) {
// Create test users
$play = new user(new user_model(
'manager',
'integration_test_manager',
$this->get_environment_variable('INTEGRATION_TEST_MANAGER_PASSWORD'),
));
$play->play();
$play = new user(new user_model(
'student',
'integration_test_student',
$this->get_environment_variable('INTEGRATION_TEST_STUDENT_PASSWORD'),
));
$play->play();
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'playbook_adler';
$plugin->release = '0.1.0';
$plugin->release = '0.2.1';
$plugin->version = 2024121000;
$plugin->requires = 2024042200;
$plugin->maturity = MATURITY_STABLE;

0 comments on commit 6e92f11

Please sign in to comment.