Remote scope
A remote scope is a configuration setting in SpecSync that defines the set of Jira Test Cases that are to be considered for synchronization from a particular SpecSync configuration.
The primary purpose of the remote scope is to detect if a local test case has been removed, for example when a scenario has been deleted from a feature file (see details below). The remote scope is also used for pull command to create new local test cases based on Jira Test Cases.
Configuring a remote scope is optional, but recommended. If no remote scope is configured SpecSync will not be able to detect removed local test cases and the related option for the pull command will not be available.
The remote scope is configured using the remote/scope
configuration section. When configuring the remote scope, you can choose from different options on how the remote scope should be maintained by SpecSync. When changing the remote scope configuration, you need to perform a full (unfiltered) push synchronization so that the remote scope is established.
The following configuration file configures a tag remote scope.
The following table contains an overview of the possible options. Please check the section How to choose remote scope type for help to decide.
tag
How to choose remote scope type
For Jira currently only the tag
remote scope type is available. We recommend to use that.
Processing removed local test cases
As mentioned above the the primary purpose of the remote scope is to detect if a local test case has been removed, for example when a scenario has been deleted from a feature file.
This detection is performed during push synchronization in a way that SpecSync loads the Test Case IDs that are in remote scope and matches them to the processed local test cases (e.g. scenarios) as the following example shows.
In this example, the Test Case #12 is in the remote scope, because SpecSync has included it earlier when the related scenario was synchronized. The scenario has been removed from the feature file, so SpecSync will not find a matching scenario for Test Case #12 therefore it is considered to be removed.
Tagging removed Test Cases
SpecSync never deletes Jira Test Cases to avoid data loss.
The Test Cases corresponding to the deleted local test are not deleted from Jira to avoid data loss, but they are tagged with specsync:removed
. The tagged Test Cases can be deleted by the user in Jira if they are not required anymore.
If the SpecSync configuration has a configuration key specified, the removed Test Cases will be tagged with a specsync:removed-from:<config-key>
tag in addition to specsync:removed
. This can help identifying which configuration was used to synchronize this Test Case earlier.
Excluding removed Test Case from hierarchies
SpecSync can synchronize Test Cases into hierarchical structures using the Test Case hierarchies feature. These structures are also maintained with removed test cases if remote scopes are used.
This means that whenever SpecSync detects a test case as removed, it will excluded it from any Test Case hierarchy it was previously included in.
Detection of removed test cases with filtered synchronization
The push synchronization can be limited to a smaller set of test cases using the --filter
command line option. This is usually used to quickly synchronize the set of the test cases the user is currently working on and not to check if test cases have been removed from the entire configuration.
Therefore by default SpecSync the removed test detection is disabled when a filtered synchronization is performed.
This behavior can be modified by setting the toolSettings/forceProcessingRemovalsOnFilter
configuration option to true
.
Undo removal
Thanks to the fact that SpecSync does not delete, but only tag the removed Test Cases, the removal is reversible.
If the removed local test case (scenario) is restored and a push synchronization is performed, SpecSync will detect that there is already a Test Case corresponding to the restored local test case and it simply removes the added specsync:removed
and specsync:removed-from:<config-key>
tags. The restored Test Case will be included again to the remote scope and to any Test Case hierarchies it has been removed from. With that the original state is restored.
Last updated
Was this helpful?