Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions launchable/commands/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ def __init__(self, app: Application):
self.output_handler = self._default_output_handler
self.exclusion_output_handler = self._default_exclusion_output_handler
self.is_get_tests_from_previous_sessions = is_get_tests_from_previous_sessions
self.is_get_tests_from_guess = is_get_tests_from_guess
self.is_output_exclusion_rules = is_output_exclusion_rules
self.is_get_tests_from_guess = is_get_tests_from_guess
super(Optimize, self).__init__(app=app)
Expand Down Expand Up @@ -486,6 +487,7 @@ def get_payload(
},
"ignoreNewTests": ignore_new_tests,
"getTestsFromPreviousSessions": self.is_get_tests_from_previous_sessions,
"getTestsFromGuess": self.is_get_tests_from_guess,
}

if target is not None:
Expand Down
3 changes: 3 additions & 0 deletions tests/cli_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def setUp(self):
if not hasattr(self, 'test_files_dir'):
self.test_files_dir = self.get_test_files_dir()

# not to use cached configuration between tests
responses.reset()

responses.add(
responses.POST,
"{}/intake/organizations/{}/workspaces/{}/builds/{}/test_sessions".format(
Expand Down
1 change: 1 addition & 0 deletions tests/data/adb/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": false,
"session": { "id": "16" },
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/ant/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"session": { "id": "16" },
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": false,
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/bazel/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": false,
"session": { "id": "16" },
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/behave/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"session": {
"id": "16"
},
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/ctest/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": false,
"session": { "id": "16" },
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/cts/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"id": "16"
},
"ignoreNewTests": false,
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false,
"goal": {
"type": "subset-by-percentage",
Expand Down
1 change: 1 addition & 0 deletions tests/data/cypress/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
]
],
"testRunner": "cypress",
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/go_test/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
[{"name": "rocket-car-gotest", "type": "class"}, {"name": "TestExample3", "type": "testcase"}],
[{"name": "rocket-car-gotest", "type": "class"}, {"name": "TestExample4", "type": "testcase"}]],
"testRunner": "go-test",
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false}
1 change: 1 addition & 0 deletions tests/data/googletest/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": false,
"session": { "id": "16" },
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/jest/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"session": { "id": "16" },
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": false,
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/maven/subset_by_absolute_time_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
},
"goal": {"type": "subset-by-absolute-time", "duration": 5400},
"ignoreNewTests": false,
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/maven/subset_by_confidence_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
},
"goal": {"type": "subset-by-confidence", "percentage": 0.9},
"ignoreNewTests": false,
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/maven/subset_from_file_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"session": {
"id": "16"
},
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/maven/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"session": {
"id": "16"
},
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/maven/subset_scan_test_compile_lst_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"session": {
"id": "16"
},
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/nunit/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": false,
"session": { "id": "16" },
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/pytest/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,6 @@
},
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": false,
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/robot/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": false,
"session": { "id": "16" },
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": false
}
1 change: 1 addition & 0 deletions tests/data/xctest/subset_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"id": "16"
},
"ignoreNewTests": false,
"getTestsFromGuess": false,
"getTestsFromPreviousSessions": true,
"useServerSideOptimizationTarget": true
}
2 changes: 2 additions & 0 deletions tests/test_runners/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def test_subset(self):
'session': {'id': str(self.session_id)},
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": False,
"getTestsFromGuess": False,
"getTestsFromPreviousSessions": False,
})
# Check split output
Expand Down Expand Up @@ -123,6 +124,7 @@ def test_subset_get_tests_from_previous_sessions(self):
'session': {'id': str(self.session_id)},
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
"ignoreNewTests": False,
"getTestsFromGuess": False,
"getTestsFromPreviousSessions": True,
})

Expand Down
Loading