Skip to content

Commit

Permalink
Merge pull request #204 from GannettDigital/issue-203
Browse files Browse the repository at this point in the history
Issue 203: Adds support for replanning with the actionTree algorithm
  • Loading branch information
scottgunther authored Oct 15, 2019
2 parents 396209e + d9bb40f commit 54c44fe
Show file tree
Hide file tree
Showing 8 changed files with 678 additions and 452 deletions.
16 changes: 11 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@

## Pending Version

## 0.8.5

* Zach Knox
* Enabled replanning support for actionTree algorithm
* Fixed replanning algorithm to output correctly when running with actionTree algorithm

## 0.8.4

* Raghu Dantuluri
* Fixed generated test names to not collide, causing test overwrites
* Raghu Dantuluri
* Fixed generated test names to not collide, causing test overwrites

## 0.8.3

* Raghu Dantuluri
* Added functionality to allow user to pass sauce connect options to the embedded sauce connect tunnel;
* Changed the generated tests' names to be based on the test plan;
* Added functionality to allow user to pass sauce connect options to the embedded sauce connect tunnel;
* Changed the generated tests' names to be based on the test plan;

## 0.8.2

* Raghu Dantuluri
* Exposed 'remote' from 'selenium-webdriver' for use in test execution
* Exposed 'remote' from 'selenium-webdriver' for use in test execution

## 0.8.1

Expand Down
14 changes: 10 additions & 4 deletions docs/pages/home/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@ toc_label: 'Version Number'
sidebar: about_sidebar
---

## 0.8.5

* Zach Knox
* Enabled replanning support for actionTree algorithm
* Fixed replanning algorithm to output correctly when running with actionTree algorithm

## 0.8.4

* Raghu Dantuluri
* Fixed generated test names to not collide, causing test overwrites
* Fixed generated test names to not collide, causing test overwrites

## 0.8.3

* Raghu Dantuluri
* Changed generated test names to be based off the test plan;
* Added functionality to allow user to pass sauce connect options to the embedded sauce connect tunnel;
* Changed generated test names to be based off the test plan;
* Added functionality to allow user to pass sauce connect options to the embedded sauce connect tunnel;


## 0.8.2

* Raghu Dantuluri
* Exposed 'remote' from 'selenium-webdriver' for use in test execution
* Exposed 'remote' from 'selenium-webdriver' for use in test execution

## 0.8.1

Expand Down
34 changes: 28 additions & 6 deletions lib/planner/search-algorithms/offline-replanning.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,25 @@ module.exports = offlineReplanning = {
offlineReplanning._savePlan(plan);
}

offlineReplanning.emitAsync(
'planner.planningFinished',
offlineReplanning._plans,
offlineReplanning._discoveredActions
);
if (offlineReplanning._algorithm.toLowerCase() === 'actiontree') {
let testCases = [];
for (let plan of offlineReplanning._plans) {
testCases.push(plan.testCase);
}
offlineReplanning.emitAsync(
'planner.planningFinished',
testCases,
offlineReplanning._discoveredActions,
offlineReplanning._algorithm
);
} else {
offlineReplanning.emitAsync(
'planner.planningFinished',
offlineReplanning._plans,
offlineReplanning._discoveredActions,
offlineReplanning._algorithm
);
}
},
* _checkForLoopAndBackTrack(plan, callback) {
let next = yield;
Expand Down Expand Up @@ -156,7 +170,15 @@ module.exports = offlineReplanning = {
_pruneExistingPlans() {
let prunedPlans = [];
for (let plan of offlineReplanning._existingPlans) {
let superset = setOperations.isSuperset(offlineReplanning._satisfiedActions, new Set(plan.path));
let superset;
if (offlineReplanning._algorithm.toLowerCase() === 'actiontree') {
// actionTree plans _are_ the path
superset = setOperations.isSuperset(offlineReplanning._satisfiedActions, new Set(plan));
} else { // forwardStateSpaceSearchHeuristic
// forwardStateSpaceSearchHeuristic plans contain an object with the plan path
superset = setOperations.isSuperset(offlineReplanning._satisfiedActions, new Set(plan.path));
}

if (!superset) {
prunedPlans.push(plan);
}
Expand Down
20 changes: 13 additions & 7 deletions lib/planner/test-planner.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,20 @@ module.exports = testPlanner = {
if (error) {
throw error;
}
// let testLength = config.get('plannerTestLength');
let testLength = false;
// TODO: Get offline replanning working with actionTree algorithm

let testLength = config.get('plannerTestLength');
if (testLength) {
testPlanner.emit('offlineReplanning.replan', finalPlans,
discoveredActions, testPlanner._algorithm, {testLength});
testPlanner.emit('offlineReplanning.replan',
finalPlans,
discoveredActions,
testPlanner._algorithm,
{
testLength,
}
);
} else {
testPlanner.emit('planner.planningFinished',
finalPlans, discoveredActions, testPlanner._algorithm);
testPlanner
.emit('planner.planningFinished', finalPlans, discoveredActions, testPlanner._algorithm);
}
});
});
Expand All @@ -59,6 +64,7 @@ module.exports = testPlanner = {
if (error) {
throw error;
}

let testLength = config.get('plannerTestLength');
if (testLength) {
testPlanner.emit('offlineReplanning.replan',
Expand Down
Loading

0 comments on commit 54c44fe

Please sign in to comment.