Skip to content

Commit

Permalink
TASK: Remove further occurrences of I am in content stream where th…
Browse files Browse the repository at this point in the history
…ey are obsolete
  • Loading branch information
mhsdesign committed Jul 1, 2024
1 parent 337f53b commit 433f369
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ Feature: Move dimension space point
to: { language: 'de_DE' }
"""
# the original content stream has not been touched
When I am in content stream "cs-identifier" and dimension space point {"language": "de"}
When I am in workspace "live" and dimension space point {"language": "de"}
Then I expect the workspace to point to content stream "cs-identifier"
Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph
And I expect this node to be of type "Neos.ContentRepository.Testing:Document"


# we find the node underneath the new DimensionSpacePoint, but not underneath the old.
When I am in workspace "migration-workspace" and dimension space point {"language": "de"}
Then I expect the workspace to point to content stream "migration-cs"
Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node
When I am in workspace "migration-workspace" and dimension space point {"language": "de_DE"}
Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de_DE"} to exist in the content graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Feature: Publishing hide/show scenario of nodes
| Key | Value |
| workspaceName | "live" |
| newContentStreamId | "cs-identifier" |
And I am in workspace "live"
And I am in workspace "live" and dimension space point {}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
Expand Down Expand Up @@ -104,12 +104,13 @@ Feature: Publishing hide/show scenario of nodes
| contentStreamIdForRemainingPart | "remaining-cs-id" |
| contentStreamIdForMatchingPart | "matching-cs-id" |
When I am in workspace "live" and dimension space point {}
When I am in workspace "live"
Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node
And I expect node aggregate identifier "nody-mc-nodeface" to lead to no node
And I expect node aggregate identifier "sir-nodeward-nodington-iii" to lead to node cs-identifier;sir-nodeward-nodington-iii;{}
When I am in content stream "remaining-cs-id" and dimension space point {}
When I am in workspace "user-test"
Then I expect the workspace to point to content stream "remaining-cs-id"
Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node
And I expect node aggregate identifier "nody-mc-nodeface" to lead to no node
And I expect node aggregate identifier "sir-nodeward-nodington-iii" to lead to no node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,20 @@ Feature: If content streams are not in use anymore by the workspace, they can be
| workspaceName | "user-test" |
| baseWorkspaceName | "live" |
| newContentStreamId | "user-cs-identifier" |
When I am in workspace "user-test" and dimension space point {}
Then I expect the workspace to point to content stream "user-cs-identifier"

When the command RebaseWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| rebasedContentStreamId | "user-cs-identifier-rebased" |
# now, we have one unused content stream (the old content stream of the user-test workspace)

When I prune unused content streams

When I am in content stream "user-cs-identifier" and dimension space point {}
Then I expect node aggregate identifier "root-node" to lead to no node
Then I expect the content stream "user-cs-identifier" to not exist

When I am in workspace "user-test" and dimension space point {}
Then I expect the workspace to point to content stream "user-cs-identifier-rebased"
Then I expect node aggregate identifier "root-node" to lead to node user-cs-identifier-rebased;root-node;{}

Scenario: NO_LONGER_IN_USE content streams can be cleaned up completely (simple case)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\NodeTypeCriteria;
use Neos\ContentRepository\Core\Projection\ContentGraph\Subtree;
use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints;
use Neos\ContentRepository\Core\Projection\Workspace\Workspace;
use Neos\ContentRepository\Core\Service\ContentStreamPruner;
use Neos\ContentRepository\Core\Service\ContentStreamPrunerFactory;
use Neos\ContentRepository\Core\SharedModel\Exception\RootNodeAggregateDoesNotExist;
Expand Down Expand Up @@ -132,31 +131,31 @@ protected function readPayloadTable(TableNode $payloadTable): array
}

/**
* @Then /^workspace "([^"]*)" points to another content stream than workspace "([^"]*)"$/
* @Then /^I expect the content stream "([^"]*)" to not exist$/
*/
public function workspacesPointToDifferentContentStreams(string $rawWorkspaceNameA, string $rawWorkspaceNameB): void
public function iExpectTheContentStreamToNotExist(string $rawContentStreamId): void
{
$workspaceA = $this->currentContentRepository->getWorkspaceFinder()->findOneByName(WorkspaceName::fromString($rawWorkspaceNameA));
Assert::assertInstanceOf(Workspace::class, $workspaceA, 'Workspace "' . $rawWorkspaceNameA . '" does not exist.');
$workspaceB = $this->currentContentRepository->getWorkspaceFinder()->findOneByName(WorkspaceName::fromString($rawWorkspaceNameB));
Assert::assertInstanceOf(Workspace::class, $workspaceB, 'Workspace "' . $rawWorkspaceNameB . '" does not exist.');
if ($workspaceA && $workspaceB) {
Assert::assertNotEquals(
$workspaceA->currentContentStreamId->value,
$workspaceB->currentContentStreamId->value,
'Workspace "' . $rawWorkspaceNameA . '" points to the same content stream as "' . $rawWorkspaceNameB . '"'
);
}
Assert::assertTrue(
$this->currentContentRepository->getContentStreamFinder()->hasContentStream(ContentStreamId::fromString($rawContentStreamId)),
sprintf('The content stream "%s" does exist.', $rawContentStreamId)
);
}

/**
* @Then /^workspace "([^"]*)" does not point to content stream "([^"]*)"$/
* @Then /^I expect the workspace to point to content stream "([^"]*)"$/
*/
public function workspaceDoesNotPointToContentStream(string $rawWorkspaceName, string $rawContentStreamId): void
public function iExpectTheWorkspaceToPointToContentStream(string $rawContentStreamId): void
{
$workspace = $this->currentContentRepository->getWorkspaceFinder()->findOneByName(WorkspaceName::fromString($rawWorkspaceName));
if ($this->currentContentStreamId !== null) {
throw new \RuntimeException('programming error. invalid case.');
}

$workspace = $this->currentContentRepository->getWorkspaceFinder()->findOneByName($this->currentWorkspaceName);

Assert::assertNotEquals($rawContentStreamId, $workspace->currentContentStreamId->value);
Assert::assertTrue(
ContentStreamId::fromString($rawContentStreamId)->equals($workspace->currentContentStreamId),
sprintf('The workspace %s was expected to point to %s but points to %s actually.', $this->currentWorkspaceName->value, $rawContentStreamId, $workspace->currentContentStreamId->value)
);
}

/**
Expand Down

0 comments on commit 433f369

Please sign in to comment.