-
Notifications
You must be signed in to change notification settings - Fork 4
SED-4672 fragments newly added via fragment manager are not registered in automation package yaml #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cmisev
merged 13 commits into
SED-4429-step-ap-ide
from
SED-4672-fragments-newly-added-via-fragment-manager-are-not-registered-in-automation-package-yaml
Jul 2, 2026
Merged
SED-4672 fragments newly added via fragment manager are not registered in automation package yaml #653
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bdeaf13
SED-4692 Refactor YAML patching logic
cl-exense 654121f
SED-4429 bugfixes and other improvements
cl-exense 87ad6ba
SED-4672 make fragments list patchable and add glob pattern if not in…
cmisev 8db63d7
Merge branch 'SED-4429-step-ap-ide' into SED-4672-fragments-newly-add…
cmisev 8e2a1d0
Merge branch 'SED-4429-step-ap-ide' into SED-4672-fragments-newly-add…
cl-exense c8f9325
SED-4672 address code assist review
cmisev bebab7a
Merge remote-tracking branch 'origin/SED-4672-fragments-newly-added-v…
cmisev 88ffe45
SED-4672 remove fragments if completely empty
cmisev 20c9673
SED-4672 fix existing reference determination
cmisev 5a1ff8f
SED-4672 fix cloning
cmisev f60d37b
SED-4672 new default for plan creation
cmisev e65f2cf
SED-4672 new unit tests for keyword adding and removal
cmisev 1c320ae
SED-4672 review comments
cmisev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
step-ap-ide/src/main/resources/work-initial/jmeterProject1/jmeterProject1.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.4.1"> | ||
|
|
||
| </jmeterTestPlan> |
Empty file.
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...llections/src/test/java/step/core/collections/AutomationPackageFragmentReferenceTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| /******************************************************************************* | ||
| * Copyright (C) 2026, exense GmbH | ||
| * | ||
| * This file is part of STEP | ||
| * | ||
| * STEP is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * STEP is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with STEP. If not, see <http://www.gnu.org/licenses/>. | ||
| ******************************************************************************/ | ||
| package step.core.collections; | ||
|
|
||
| import org.junit.Before; | ||
| import org.junit.Test; | ||
| import step.artefacts.Echo; | ||
| import step.artefacts.Sequence; | ||
| import step.automation.packages.AutomationPackageReadingException; | ||
| import step.automation.packages.yaml.AutomationPackageYamlFragmentManager; | ||
| import step.core.artefacts.AbstractArtefact; | ||
| import step.core.dynamicbeans.DynamicValue; | ||
| import step.core.plans.Plan; | ||
| import step.core.yaml.deserialization.AutomationPackageConcurrentEditException; | ||
| import step.plans.parser.yaml.YamlPlan; | ||
|
|
||
| import java.io.IOException; | ||
| import java.nio.file.Files; | ||
| import java.nio.file.StandardCopyOption; | ||
| import java.util.*; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| import static org.junit.Assert.*; | ||
|
|
||
| public class AutomationPackageFragmentReferenceTest extends AutomationPackageCollectionTestBase { | ||
|
|
||
| private Collection<Plan> planCollection; | ||
|
|
||
| public AutomationPackageFragmentReferenceTest() { | ||
| super(); | ||
| } | ||
|
|
||
| @Before | ||
| public void setUp() throws IOException, AutomationPackageReadingException { | ||
| super.setUp(); | ||
| AutomationPackageCollectionFactory collectionFactory = new AutomationPackageCollectionFactory(new Properties(), fragmentManager); | ||
| planCollection = collectionFactory.getCollection(YamlPlan.PLANS_ENTITY_NAME, Plan.class); | ||
| } | ||
|
|
||
|
|
||
| @Test | ||
| public void testAddPlanToNewFragmentAndRename() throws IOException { | ||
|
|
||
| Sequence sequence = new Sequence(); | ||
| Echo echo = new Echo(); | ||
| echo.setText(new DynamicValue<>("Hello World")); | ||
| sequence.addChild(echo); | ||
|
|
||
| Plan plan = new Plan(sequence); | ||
| Map<String, String> attributes = new HashMap<>(); | ||
| attributes.put(AbstractArtefact.NAME, "Hello World Plan"); | ||
| plan.setAttributes(attributes); | ||
|
|
||
| setPropertiesWriteMode(YamlPlan.PLANS_ENTITY_NAME, "newPlansPath", AutomationPackageYamlFragmentManager.NewObjectFragmentMode.PER_OBJECT); | ||
|
|
||
| planCollection.save(plan); | ||
|
|
||
| assertFilesEqual(expectedFilesPath.resolve("Hello World Plan.yml"), destinationDirectory.toPath().resolve("newPlansPath").resolve("Hello World Plan.yml")); | ||
| assertFilesEqual(expectedFilesPath.resolve("descriptorAfterNewFragmentReference.yml"), destinationDirectory.toPath().resolve("automation-package.yml")); | ||
|
|
||
| attributes.put(AbstractArtefact.NAME, "This Plan was renamed"); | ||
|
|
||
| planCollection.save(plan); | ||
|
|
||
| assertFilesEqual(expectedFilesPath.resolve("This Plan was renamed.yml"), destinationDirectory.toPath().resolve("newPlansPath").resolve("This Plan was renamed.yml")); | ||
| assertFilesEqual(expectedFilesPath.resolve("descriptorAfterNewFragmentReference.yml"), destinationDirectory.toPath().resolve("automation-package.yml")); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...tep-automation-packages-collections/src/test/resources/expected/This Plan was renamed.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| plans: | ||
| - name: "This Plan was renamed" | ||
| root: | ||
| sequence: | ||
| children: | ||
| - echo: | ||
| text: "Hello World" |
26 changes: 26 additions & 0 deletions
26
...-packages-collections/src/test/resources/expected/descriptorAfterNewFragmentReference.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| schemaVersion: 1.0.0 | ||
| name: "My package" | ||
| alertingRules: | ||
| - name: "Rule1" | ||
| description: "My test alerting rule" | ||
| eventClass: ExecutionEndedEvent | ||
| conditions: | ||
| - BindingCondition: | ||
| description: "condition 1" | ||
| bindingKey: "myKey" | ||
| negate: false | ||
| predicate: | ||
| BindingValueEqualsPredicate: | ||
| value: "myValue" | ||
| plans: [] | ||
| parameters: | ||
| - key: "paramInMainAP" | ||
| value: "once" | ||
| fragments: | ||
| - "keywords.yml" | ||
| - "plans/*.yml" | ||
| - "schedules.yml" | ||
| - "parameters.yml" | ||
| - "parameters2.yml" | ||
| - "unknown.yml" | ||
| - "newPlansPath/*.yml" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.