Tests: Remove drop-in tests loading archives written by main

testExistingArchivesRestoreTheOriginalView and
testExistingCibsProduceTheSameObjects decoded archives and cibs written
by main, laid out the decoded views, and compared them against main's
views after main's layout.

Early in the migration they guarded the ability to load cibs verbatim
regardless of framework or tooling state, which reduced friction when
comparing the new and legacy toolchains.

That need has passed: rebuilding an application against updated frameworks
re-runs nib2cib and regenerates cibs, so stale build products do not meet newer frameworks.
Keeping those tests only causes false failures on valid changes, such as to layout.

The round-trip test, which writes and reads archives within the same
build, remains.
This commit is contained in:
David Richardson committed 2026-12-02 17:28:41 -06:00
1 parent eb780a5d61
commit 082d9e24bd
1 file changed
+10 -87
+10 -87
View File
@@ -23,20 +23,20 @@
@import "DropInArchiveFixtures.j"
/*
Every application with an interface built in Xcode depends on cibs, and those
cibs were written before the application's frameworks were last updated. An
application that updates its frameworks does not rebuild them first, so the
frameworks must keep reading what was already written. A new key may be added to
an archive. Its absence from an older archive must then mean the old behavior,
and not a new default.
The frameworks must read back what they write. A cib is a build product: an
application that updates its frameworks is rebuilt, and nib2cib writes its cibs
again with the frameworks' own encoders. So the archives under test are written
and read by the same build.
2026-12-02: two tests here read archives and cibs written by main and compared
them with main's views after main's layout. They tested that stale build products
load with newer frameworks, which the build never requires, and a correct change
to layout failed them. They are removed.
The reference for a view is the view before it was archived, so a build cannot
pass by restoring something else. A warning during decoding is a failure. The
classes under test are those in the drop-in baseline, so a class cannot leave
these tests unnoticed.
DropInArchiveGenerator.j saves the data these tests read. Each test reports every
difference it finds.
this test unnoticed. The test reports every difference it finds.
*/
var fs = require("fs"),
path = require("path");
@@ -123,81 +123,4 @@ var fs = require("fs"),
[self assertNoDifferences:differences];
}
/*
An archive written by main must restore the view it was written from.
The descriptions compared must be the same on every machine. A date, and the
string value of a control that holds one, are recorded by the date's instant in
UTC, because their text is in the local time zone (DropInSnapshot.j). GitHub's
continuous integration runs this test in UTC, so run it in UTC as well as in the
local time zone before committing a change:
TZ=UTC npx jake test
*/
- (void)testExistingArchivesRestoreTheOriginalView
{
var archivePath = path.join(resources, @"DropInArchives.json");
[self assertTrue:fs.existsSync(archivePath) message:@"DropInArchives.json has not been generated"];
var archives = [self jsonNamed:@"DropInArchives.json"],
differences = [];
[self viewClassNames].forEach(function(aClassName)
{
var saved = archives[aClassName];
if (!saved)
return differences.push(aClassName + ": no saved archive");
try
{
DropInTreeDifferences(saved.state, DropInSavedArchiveTree(saved.archive), aClassName, differences);
}
catch (anException)
{
differences.push(aClassName + ": " + String(anException));
}
[self moveWarningsNamed:aClassName into:differences];
});
[self assertNoDifferences:differences];
}
/*
These are fixed copies of real cibs, and they do not follow their sources. They are
Tests/Manual/SmartFoldersTest/Resources/PredicateEditor.cib and
Tests/Manual/TextEditor/Resources/DocumentWindow.cib, as of commit 5db5adac0.
Loading one must produce the same windows, views and frames as main. The MainMenu
cibs of those applications are not here. TextEditor's shows a menu bar, which needs
a platform window, and SmartFoldersTest's connects a data source that is defined by
the application.
*/
- (void)testExistingCibsProduceTheSameObjects
{
var expected = [self jsonNamed:@"DropInCibs.json"],
differences = [];
for (var cibName in expected)
{
var rawString = fs.readFileSync(path.join(resources, "DropInCibs", cibName), {encoding: 'utf-8'}),
current = DropInCibTree(cibName, rawString),
expectedTrees = expected[cibName];
if (current.length !== expectedTrees.length)
{
differences.push(cibName + ": " + expectedTrees.length + " top level objects are now " + current.length);
continue;
}
for (var index = 0; index < current.length; index++)
DropInTreeDifferences(JSON.parse(expectedTrees[index]), JSON.parse(current[index]), cibName, differences);
[self moveWarningsNamed:cibName into:differences];
}
[self assertNoDifferences:differences];
}
@end