The Drupal 7 core test ModuleDependencyTestCase::testIncompatibleModuleVersionDependency fails for me locally if I use a packaged core version as opposed to Git. It expects version = 1.0 which is hardcoded in simpletest/tests/system_incompatible_module_version_test.info instead of the version = 7.28 that is appended by the packaging script.

CommentFileSizeAuthor
#1 drupalorg-versions.patch1.58 KBstefan.r

Comments

stefan.r’s picture

Status: Active » Needs review
StatusFileSize
new1.58 KB
stefan.r’s picture

As this feels a bit convoluted there is also the option of fixing the tests themselves to expect a version = 7.xx (for the D7 test) or version = 8.xx string (for the D8 test) instead of the hardcoded version = 1.0

sun’s picture

Unlike YAML in D8, the .info format parser (derived from INI) in D7 always consumes the last value of a property, if the property is specified multiple times.

For example:

foo = first
foo = second

yields:

array(
  'foo' => 'second',
)

The only sensible fix here would be to change the test in core to not have an absolute expectation... but that would defeat the test's purpose.

stefan.r’s picture

@sun what if we change the test & info file to use the VERSION constant instead of 1.0? Isn't that the same version that will be appended by the packaging script?

Also just a heads up about the parsing order, if for D8 the packaging script is still going to append the new version after the previously defined one, it is a change in behavior as versions aren't "overwritten" anymore. But it would also mean this issue ceases to exist for the D8 test :)

drumm’s picture

Status: Needs review » Closed (outdated)
Related issues: +#3075062: Remove core key overriding in .info.yml packaging

Overriding the core compatibility line was removed with #3075062: Remove core key overriding in .info.yml packaging