Skip to content
Snippets Groups Projects
Commit f006b3fd authored by omkar podey's avatar omkar podey Committed by Ted Bowman
Browse files

Issue #3317815 by omkar.podey, tedbow: Remove all fixtures except for one: `fake_site`

parent 2b61b5e3
No related branches found
No related tags found
1 merge request!661Issue #3317815: Remove all fixtures except for one: `fake_site`
Showing
with 19 additions and 7 deletions
......@@ -40,7 +40,7 @@ class ModuleUpdateTest extends UpdateTestBase {
\$config['update_test.settings']['system_info'] = $system_info;
END;
$this->writeSettings($code);
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../../../package_manager/tests/fixtures/alpha/1.0.0'));
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../../../package_manager/tests/fixtures/build_test_projects/alpha/1.0.0'));
$this->runComposer('COMPOSER_MIRROR_PATH_REPOS=1 composer require drupal/alpha --update-with-all-dependencies', 'project');
$this->assertModuleVersion('alpha', '1.0.0');
$fs = new SymfonyFilesystem();
......@@ -52,7 +52,7 @@ END;
]);
// Change both modules' upstream version.
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../../../package_manager/tests/fixtures/alpha/1.1.0'));
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../../../package_manager/tests/fixtures/build_test_projects/alpha/1.1.0'));
}
/**
......
# Why do we need the `updated_module` fixtures?
Because there is a need to thoroughly test the updating of a module. See `\Drupal\Tests\package_manager\Build\PackageUpdateTest`.
This requires 2 versions (`1.0.0` and `1.1.0`) of the same module (`updated_module`), each with a different code bases.
The test updates from one version to the next, and verifies the updated module's code base is actually used after the update: it verifies the updated logic of version of `\Drupal\updated_module\PostApplySubscriber` is being executed.
`\Drupal\fixture_manipulator\FixtureManipulator` cannot manipulate code nor does it modify the file system: it only creates a "skeleton" extension. (See `\Drupal\fixture_manipulator\FixtureManipulator::addProjectAtPath()`.)
# Why do we need the `alpha` fixtures?
To be able to test that `php-tuf/composer-stager` indeed only updates the package for which an update was requested (even though more updates are available), no fixture manipulation is allowed to occur. This requires updating a `path` composer package repository to first serve contain one version of a package, and then another. That is what these fixtures are used for.
......@@ -21,7 +21,7 @@ class PackageInstallTest extends TemplateProjectTestBase {
$this->setReleaseMetadata([
'alpha' => __DIR__ . '/../../fixtures/release-history/alpha.1.1.0.xml',
]);
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/alpha/1.0.0'));
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/build_test_projects/alpha/1.0.0'));
// Use the API endpoint to create a stage and install alpha 1.0.0. We ask
// the API to return the contents of composer.json file of installed module,
......
......@@ -20,8 +20,8 @@ class PackageUpdateTest extends TemplateProjectTestBase {
public function testPackageUpdate(): void {
$this->createTestProject('RecommendedProject');
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/alpha/1.0.0'));
$this->addRepository('updated_module', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/updated_module/1.0.0'));
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/build_test_projects/alpha/1.0.0'));
$this->addRepository('updated_module', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/build_test_projects/updated_module/1.0.0'));
$this->setReleaseMetadata([
'updated_module' => __DIR__ . '/../../fixtures/release-history/updated_module.1.1.0.xml',
]);
......@@ -32,8 +32,8 @@ class PackageUpdateTest extends TemplateProjectTestBase {
$this->installModules(['updated_module']);
// Change both modules' upstream version.
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/alpha/1.1.0'));
$this->addRepository('updated_module', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/updated_module/1.1.0'));
$this->addRepository('alpha', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/build_test_projects/alpha/1.1.0'));
$this->addRepository('updated_module', $this->copyFixtureToTempDirectory(__DIR__ . '/../../fixtures/build_test_projects/updated_module/1.1.0'));
// Make .git folder
// Use the API endpoint to create a stage and update updated_module to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment