diff --git a/.ci/flake8_blacklist.txt b/.ci/flake8_blacklist.txt index 26ece30af32..f5276b3fc47 100644 --- a/.ci/flake8_blacklist.txt +++ b/.ci/flake8_blacklist.txt @@ -15,3 +15,5 @@ lib/galaxy/util/jstree.py lib/galaxy/web/proxy/js/node_modules static/maps static/scripts +build +dist diff --git a/.gitignore b/.gitignore index e52c67610a4..d17e2a9d68f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,17 @@ scripts/scramble/archives .venv .venv3 +# Python build artifacts +build +dist +lib/galaxy.egg-info +.eggs + +# Generated static content +lib/galaxy/web/framework/static/maps +lib/galaxy/web/framework/static/scripts +lib/galaxy/web/framework/static/style + # Database stuff database/beaker_sessions database/citations diff --git a/.travis.yml b/.travis.yml index 32b0bba580d..942e8625b46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: sh scripts/common_startup.sh wget -q https://github.com/jmchilton/galaxy-downloads/raw/master/db_gx_rev_0127.sqlite mv db_gx_rev_0127.sqlite database/universe.sqlite - sh manage_db.sh -c ./config/galaxy.yml.sample upgrade + sh manage_db.sh upgrade elif [ "$TOX_ENV" == "py35-first_startup" ]; then MINICONDA_URL="https://repo.anaconda.com/miniconda" MINICONDA_FILE="Miniconda3-latest-MacOSX-x86_64.sh" diff --git a/client/galaxy/scripts/components/PluginList.vue b/client/galaxy/scripts/components/PluginList.vue index 2909e7e9439..2f70becf0c7 100644 --- a/client/galaxy/scripts/components/PluginList.vue +++ b/client/galaxy/scripts/components/PluginList.vue @@ -2,14 +2,16 @@
| <%= _.escape(item.get("file_size")) %> | |||
| Date last updated (UTC) | +<%= _.escape(item.get("update_time")) %> | +||
|---|---|---|---|
| Date uploaded (UTC) | @@ -880,6 +886,12 @@ var LibraryDatasetView = Backbone.View.extend({<%= _.escape(ldda.get("file_size")) %> | ||
| Date last updated (UTC) | +<%= _.escape(ldda.get("update_time")) %> | +||
| Date uploaded (UTC) | @@ -1006,6 +1018,10 @@ var LibraryDatasetView = Backbone.View.extend({Size | <%= _.escape(item.get("file_size")) %> | |
| Date last updated (UTC) | +<%= _.escape(item.get("update_time")) %> | +||
| Date uploaded (UTC) | <%= _.escape(item.get("date_uploaded")) %> | diff --git a/client/galaxy/scripts/mvc/library/library-folderlist-view.js b/client/galaxy/scripts/mvc/library/library-folderlist-view.js index 1b6c271f99c..cedc161f341 100644 --- a/client/galaxy/scripts/mvc/library/library-folderlist-view.js +++ b/client/galaxy/scripts/mvc/library/library-folderlist-view.js @@ -517,7 +517,7 @@ var FolderListView = Backbone.View.extend({- Time Updated (UTC) + Date Updated (UTC) |
diff --git a/client/galaxy/scripts/mvc/library/library-util.js b/client/galaxy/scripts/mvc/library/library-util.js
index c4d546c4b25..bb174a7cb56 100644
--- a/client/galaxy/scripts/mvc/library/library-util.js
+++ b/client/galaxy/scripts/mvc/library/library-util.js
@@ -1,45 +1,38 @@
/**
- * Create alphabetical based two-argument comparator
- * that takes into account that Folder comes before Dataset.
+ * Create alphabetical based two-argument comparator to handle library items (including folders)
* If sort_key is not present it is set to ''.
* @param {str} sort_key key to sort by
* @param {str} sort_order order to sort by (asc, desc)
* @return {function} two-argument comparator function
*/
var generateComparator = (sort_key, sort_order) => (itemA, itemB) => {
- if (itemA.get("type") === itemB.get("type")) {
- if (!itemA.has(sort_key) && !itemB.has(sort_key)) {
- return 0;
- } else if (!itemA.has(sort_key)) {
- return 1;
- } else if (!itemB.has(sort_key)) {
- return -1;
- }
- var comparable_itemA_key;
- var comparable_itemB_key;
- if (typeof itemA.get(sort_key) === "number") {
- comparable_itemA_key = itemA.get(sort_key);
- comparable_itemB_key = itemB.get(sort_key);
- }
- else
- {
- comparable_itemA_key = itemA.get(sort_key).toLowerCase();
- comparable_itemB_key = itemB.get(sort_key).toLowerCase();
- }
- if ( comparable_itemA_key > comparable_itemB_key) {
- return sort_order === "asc" ? 1 : -1;
- }
- if (comparable_itemB_key > comparable_itemA_key) {
- return sort_order === "asc" ? -1 : 1;
- }
-
- return 0; // equal
- } else {
- if (itemA.get("type") === "folder") {
- return -1; // folder is always before dataset
- }
+ if (!itemA.has(sort_key) && !itemB.has(sort_key)) {
+ return 0;
+ } else if (!itemA.has(sort_key)) {
return 1;
+ } else if (!itemB.has(sort_key)) {
+ return -1;
}
+ var comparable_itemA_key;
+ var comparable_itemB_key;
+ if (typeof itemA.get(sort_key) === "number") {
+ comparable_itemA_key = itemA.get(sort_key);
+ comparable_itemB_key = itemB.get(sort_key);
+ }
+ else
+ {
+ comparable_itemA_key = itemA.get(sort_key).toLowerCase();
+ comparable_itemB_key = itemB.get(sort_key).toLowerCase();
+ }
+
+ if ( comparable_itemA_key > comparable_itemB_key) {
+ return sort_order === "asc" ? 1 : -1;
+ }
+ if (comparable_itemB_key > comparable_itemA_key) {
+ return sort_order === "asc" ? -1 : 1;
+ }
+
+ return 0; // equal
};
export default {
generateComparator: generateComparator
diff --git a/client/galaxy/scripts/mvc/rules/rule-definitions.js b/client/galaxy/scripts/mvc/rules/rule-definitions.js
index 23ccb754b8f..29909912306 100644
--- a/client/galaxy/scripts/mvc/rules/rule-definitions.js
+++ b/client/galaxy/scripts/mvc/rules/rule-definitions.js
@@ -42,7 +42,7 @@ const applyRegex = function(regex, target, data, replacement, groupCount) {
return null;
}
if (!replacement) {
- groupCount = groupCount && parseInt(groupCount);
+ groupCount = groupCount && parseInt(groupCount, 10);
if (groupCount) {
if (match.length != groupCount + 1) {
failedCount++;
@@ -108,7 +108,7 @@ const RULES = {
}
},
save: (component, rule) => {
- rule.start = parseInt(component.addColumnRownumStart);
+ rule.start = parseInt(component.addColumnRownumStart, 10);
},
apply: (rule, data, sources, columns) => {
let rownum = rule.start;
@@ -169,7 +169,7 @@ const RULES = {
const ruleValue = rule.value;
let newRow;
if (ruleValue.indexOf("identifier") == 0) {
- const identifierIndex = parseInt(ruleValue.substring("identifier".length));
+ const identifierIndex = parseInt(ruleValue.substring("identifier".length), 10);
newRow = (row, index) => {
const newRow = row.slice();
newRow.push(sources[index]["identifiers"][identifierIndex]);
@@ -253,7 +253,7 @@ const RULES = {
component.addColumnRegexTarget = rule.target_column;
component.addColumnRegexExpression = rule.expression;
component.addColumnRegexReplacement = rule.replacement;
- component.addColumnRegexGroupCount = rule.group_count;
+ component.addColumnRegexGroupCount = parseInt(rule.group_count);
}
let addColumnRegexType = "global";
if (component.addColumnRegexGroupCount) {
@@ -347,7 +347,7 @@ const RULES = {
},
save: (component, rule) => {
rule.target_column = component.addColumnSubstrTarget;
- rule.length = parseInt(component.addColumnSubstrLength);
+ rule.length = parseInt(component.addColumnSubstrLength, 10);
rule.substr_type = component.addColumnSubstrType;
},
apply: (rule, data, sources, columns) => {
@@ -403,7 +403,7 @@ const RULES = {
function newRow(row) {
const newRow = [];
for (const index in row) {
- if (targets.indexOf(parseInt(index)) == -1) {
+ if (targets.indexOf(parseInt(index, 10)) == -1) {
newRow.push(row[index]);
}
}
@@ -448,7 +448,7 @@ const RULES = {
const target = rule.target_column;
const invert = rule.invert;
const filterFunction = function(el, index) {
- const row = data[parseInt(index)];
+ const row = data[parseInt(index, 10)];
return regExp.exec(row[target]) ? !invert : invert;
};
sources = sources.filter(filterFunction);
@@ -477,13 +477,13 @@ const RULES = {
component.addFilterCountWhich = "first";
component.addFilterCountInvert = false;
} else {
- component.addFilterCountN = parseInt(rule.count);
+ component.addFilterCountN = parseInt(rule.count, 10);
component.addFilterCountWhich = rule.which;
component.addFilterCountInvert = rule.inverse;
}
},
save: (component, rule) => {
- rule.count = parseInt(component.addFilterCountN);
+ rule.count = parseInt(component.addFilterCountN, 10);
rule.which = component.addFilterCountWhich;
rule.invert = component.addFilterCountInvert;
},
@@ -528,7 +528,7 @@ const RULES = {
const target = rule.target_column;
const invert = rule.invert;
const filterFunction = function(el, index) {
- const row = data[parseInt(index)];
+ const row = data[parseInt(index, 10)];
return row[target].length ? !invert : invert;
};
sources = sources.filter(filterFunction);
@@ -562,7 +562,7 @@ const RULES = {
const invert = rule.invert;
const value = rule.value;
const filterFunction = function(el, index) {
- const row = data[parseInt(index)];
+ const row = data[parseInt(index, 10)];
return row[target] == value ? !invert : invert;
};
sources = sources.filter(filterFunction);
@@ -598,7 +598,7 @@ const RULES = {
const compare_type = rule.compare_type;
const value = rule.value;
const filterFunction = function(el, index) {
- const row = data[parseInt(index)];
+ const row = data[parseInt(index, 10)];
const targetValue = parseFloat(row[target]);
let matches;
if (compare_type == "less_than") {
@@ -730,7 +730,7 @@ const RULES = {
const newRow0 = [],
newRow1 = [];
for (let index in row) {
- index = parseInt(index);
+ index = parseInt(index, 10);
if (targets0.indexOf(index) > -1) {
newRow0.push(row[index]);
} else if (targets1.indexOf(index) > -1) {
diff --git a/client/galaxy/scripts/mvc/tool/tools.js b/client/galaxy/scripts/mvc/tool/tools.js
index d1831083fb9..ddda58bc452 100644
--- a/client/galaxy/scripts/mvc/tool/tools.js
+++ b/client/galaxy/scripts/mvc/tool/tools.js
@@ -347,9 +347,7 @@ var ToolSearch = Backbone.Model.extend({
SEARCH_RESERVED_TERMS_FAVORITES: ["#favs", "#favorites", "#favourites"],
defaults: {
- search_hint_string: "search tools",
min_chars_for_search: 3,
- clear_btn_url: "",
visible: true,
query: "",
results: null,
@@ -635,7 +633,7 @@ var ToolSectionView = BaseView.extend({
var ToolSearchView = Backbone.View.extend({
tagName: "div",
id: "tool-search",
- className: "bar",
+ className: "search-input",
events: {
click: "focus_and_select",
@@ -649,7 +647,6 @@ var ToolSearchView = Backbone.View.extend({
if (!this.model.is_visible()) {
this.$el.hide();
}
-
this.$el.find("[title]").tooltip();
return this;
},
@@ -774,10 +771,9 @@ var templates = {
// the search bar at the top of the tool panel
tool_search: _.template(
`
-
-
- `
+ placeholder="search tools" autocomplete="off" type="text" />
+
+ `
),
// the category level container in the tool panel (e.g. 'Get Data', 'Text Manipulation')
diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view.js b/client/galaxy/scripts/mvc/workflow/workflow-view.js
index eb5449e4268..f4a29b16cf1 100644
--- a/client/galaxy/scripts/mvc/workflow/workflow-view.js
+++ b/client/galaxy/scripts/mvc/workflow/workflow-view.js
@@ -47,6 +47,7 @@ function reset_tool_search(initValue) {
// Reset search input.
tool_menu_frame.find("#search-spinner").hide();
+ tool_menu_frame.find("#search-clear-btn").show();
if (initValue) {
var search_input = tool_menu_frame.find("#tool-search-query");
search_input.val("search tools");
@@ -155,6 +156,7 @@ export default Backbone.View.extend({
}
// Start a new ajax-request in X ms
$("#search-spinner").show();
+ $("#search-clear-btn").hide();
this.timer = window.setTimeout(() => {
$.get(
self.urls.tool_search,
@@ -209,6 +211,7 @@ export default Backbone.View.extend({
$("#search-no-results").show();
}
$("#search-spinner").hide();
+ $("#search-clear-btn").show();
},
"json"
);
diff --git a/client/galaxy/style/scss/base.scss b/client/galaxy/style/scss/base.scss
index 4a0bbe2a8e9..2e2cb4c6ede 100644
--- a/client/galaxy/style/scss/base.scss
+++ b/client/galaxy/style/scss/base.scss
@@ -735,54 +735,6 @@ button {
}
}
-.search-query {
- display: inline-block;
- padding: 4px;
- font-size: $font-size-base;
- line-height: $line-height-base;
- color: $text-color;
- border: 1px solid $border-default-color;
- padding-left: 14px !important;
- padding-right: 14px;
- margin-bottom: 0;
- @include border-radius(14px);
- background: $brand-white;
-}
-.search-query:focus {
- border-color: darken(rgba(82, 168, 236, 0.8), 15%);
- $shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
- @include box-shadow($shadow);
- outline: 0;
- outline: thin dotted \9; /* IE6-8 */
-}
-
-.search-spinner {
- position: absolute;
- display: none;
- right: 6px;
- top: 5px;
- font-size: 1.4em;
- color: #888;
-}
-
-#tool-search {
- position: relative;
- @extend .mb-2;
- #search-clear-btn {
- position: absolute;
- right: 6px;
- top: 6px;
- display: block;
- font-size: 1.4em !important;
- text-decoration: none;
- color: #888;
- @extend .fa-icon;
- &:before {
- content: "\f057";
- }
- }
-}
-
// Messages
.errormessagelarge,
@@ -1477,55 +1429,59 @@ div.permissionContainer {
.toolMenuContainer {
color: $panel-text-color;
a {
- color: $panel-text-color;
+ color: $panel-text-color;
}
background: $panel-bg-color;
min-height: 100%;
- @extend .m-3;
-}
-
-div.toolSectionWrapper {
- @extend .mb-1;
}
div.toolSectionTitle {
font-weight: 500;
font-size: $h4-font-size;
-}
-
-div.toolPanelLabel {
- @extend .mt-3;
- @extend .mb-2;
- font-weight: bold;
- color: $gray-600;
- text-transform: uppercase;
-}
-
-div.toolTitle {
- @extend .m-2;
- display: block;
- .labels {
- float: right;
- }
-}
-
-div a.tool-link {
- text-decoration: none;
- display: block;
- span.tool-old-link {
- text-decoration: underline;
- }
&:hover {
background: darken($panel-bg-color, 5%);
}
}
-div.toolTitleNoSection {
- @extend .pb-1;
+div.toolPanelLabel {
+ @extend .py-1;
+ @extend .px-3;
font-weight: bold;
+ font-size: $h4-font-size;
+ color: $gray-600;
+ text-transform: uppercase;
+}
+
+div.toolSectionTitle, div.toolTitle, div.toolTitleNoSection {
+ display: block;
+ .labels {
+ float: right;
+ }
+
+ a {
+ @extend .px-3;
+ @extend .py-1;
+ text-decoration: none;
+ display: block;
+ &:hover {
+ background: darken($panel-bg-color, 5%);
+ }
+ }
+
+ &.text-muted a {
+ &:hover {
+ background: inherit;
+ }
+ }
+}
+
+div.toolSectionWrapper {
+ div.toolTitle a, div.toolPanelLabel {
+ @extend .pl-4;
+ font-size: inherit;
+ }
}
-// Dataset Display Styles
#loading_indicator {
position: fixed;
right: 10px;
diff --git a/client/galaxy/style/scss/history.scss b/client/galaxy/style/scss/history.scss
index 8bea041c41e..4e4686de8d8 100644
--- a/client/galaxy/style/scss/history.scss
+++ b/client/galaxy/style/scss/history.scss
@@ -470,21 +470,6 @@
.btn {
@extend .btn-sm;
}
- .search-control {
- display: inline-block;
- width: 40%;
-
- .search-clear,
- .search-loading {
- margin-top: -22px;
- }
- }
- input.search-query {
- font-size: 90%;
- height: 21px;
- line-height: normal;
- padding: 2px 2px 1px 2px;
- }
.open-more-options {
padding: 2px 6px 2px 6px;
font-size: 100%;
diff --git a/client/galaxy/style/scss/theme/blue.scss b/client/galaxy/style/scss/theme/blue.scss
index de520a37669..a6d2e196b6d 100644
--- a/client/galaxy/style/scss/theme/blue.scss
+++ b/client/galaxy/style/scss/theme/blue.scss
@@ -114,7 +114,9 @@ $layout-border: none;
// Borders
$border-radius-base: 0.1875rem;
$border-radius-large: 0.3125rem;
+$border-radius-extralarge: 1rem;
$border-default-color: $gray-400;
+$border-default: 1px solid $border-default-color;
// Buttons
$btn-default-color: $text-color;
diff --git a/client/galaxy/style/scss/ui/search-input.scss b/client/galaxy/style/scss/ui/search-input.scss
index 71b0d9290ca..1b35779a931 100644
--- a/client/galaxy/style/scss/ui/search-input.scss
+++ b/client/galaxy/style/scss/ui/search-input.scss
@@ -1,26 +1,37 @@
-// search bar, see: scripts/jq-plugins/ui/search-input.js
.search-input {
- .search-query {
- width: 100%;
- padding-right: 24px;
- }
+ @extend .mb-2;
.search-clear,
.search-loading {
- // it places the icons on the right of the bar (and puts the lotion on its skin)
+ @extend .mr-2;
position: relative;
display: inline-block;
-
float: right;
margin-top: -25px;
- margin-right: 4px;
-
font-size: 1.4em;
- line-height: 23px;
- color: grey;
+ color: $gray-500;
}
-
.search-clear:hover {
- color: $link-color;
+ color: $brand-info;
cursor: pointer;
}
+ .search-loading {
+ display: none;
+ }
+ .search-query {
+ @extend .px-3;
+ @extend .py-1;
+ width: 100%;
+ display: inline-block;
+ font-size: $font-size-base;
+ line-height: $line-height-base;
+ color: $text-color;
+ border: $border-default;
+ @include border-radius($border-radius-extralarge);
+ max-width: auto;
+ background: $brand-white;
+ }
+ .search-query:focus {
+ border-color: $brand-info;
+ outline: 0;
+ }
}
diff --git a/client/webpack.config.js b/client/webpack.config.js
index 20a17781fd9..b1833ce6a94 100644
--- a/client/webpack.config.js
+++ b/client/webpack.config.js
@@ -19,7 +19,7 @@ let buildconfig = {
generic: ["polyfills", "bundleEntries", "entry/generic"]
},
output: {
- path: path.join(__dirname, "../", "static/scripts/bundled"),
+ path: path.join(__dirname, "../", "lib/galaxy/web/framework/static/scripts/bundled"),
publicPath: "/static/scripts/bundled/",
filename: "[name].bundled.js",
chunkFilename: "[name].chunk.js"
diff --git a/config/auth_conf.xml.sample b/config/auth_conf.xml.sample
deleted file mode 100644
index 34d30693b72..00000000000
--- a/config/auth_conf.xml.sample
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
diff --git a/templates/webapps/galaxy/workflow/editor.mako b/templates/webapps/galaxy/workflow/editor.mako
index 09f66de636d..187f634ca99 100644
--- a/templates/webapps/galaxy/workflow/editor.mako
+++ b/templates/webapps/galaxy/workflow/editor.mako
@@ -91,13 +91,15 @@
%else:
Accessible Galaxy tool sheds
-
- <% shed_id = 0 %>
- %for name, url in trans.app.tool_shed_registry.tool_sheds.items():
- <% margin_cls = "mt-2" if shed_id > 0 else "" %>
-
-
-
-- <% shed_id += 1 %> - %endfor -
%endif
- %if "[[" in tool.description and "]]" in tool.description:
- ${tool.description.replace( '[[', '' % tool.id ).replace( "]]", "" )}
- %elif tool.name:
- ${tool.name} ${tool.description}
- %else:
- ${tool.description}
- %endif
+
+ %if "[[" in tool.description and "]]" in tool.description:
+ ${tool.description.replace( '[[', '' % tool.id ).replace( "]]", "" )}
+ %elif tool.name:
+ ${tool.name} ${tool.description}
+ %else:
+ ${tool.description}
+ %endif
+
%endif
%endif
@@ -146,10 +148,10 @@
-
diff --git a/test/api/test_libraries.py b/test/api/test_libraries.py
index a9f8d5f4f05..11454c23695 100644
--- a/test/api/test_libraries.py
+++ b/test/api/test_libraries.py
@@ -232,6 +232,26 @@ class LibrariesApiTestCase(api.ApiTestCase, TestsDatasets):
self._assert_status_code_is(create_response, 200)
self._assert_has_keys(create_response.json(), "name", "id")
+ def test_create_dataset_in_subfolder(self):
+ library = self.library_populator.new_private_library("ForCreateDatasets")
+ folder_response = self._create_folder(library)
+ self._assert_status_code_is(folder_response, 200)
+ folder_id = folder_response.json()[0]['id']
+ subfolder_response = self._create_subfolder(folder_id)
+ self._assert_status_code_is(folder_response, 200)
+ print(subfolder_response.json())
+ subfolder_id = subfolder_response.json()['id']
+ history_id = self.dataset_populator.new_history()
+ hda_id = self.dataset_populator.new_dataset(history_id, content="1 2 3 sub")['id']
+ payload = {'from_hda_id': hda_id}
+ create_response = self._post("folders/%s/contents" % subfolder_id, payload)
+ self._assert_status_code_is(create_response, 200)
+ self._assert_has_keys(create_response.json(), "name", "id")
+ dataset_update_time = create_response.json()['update_time']
+ container_fetch_response = self.galaxy_interactor.get("folders/%s/contents" % folder_id)
+ container_update_time = container_fetch_response.json()['folder_contents'][0]['update_time']
+ assert dataset_update_time == container_update_time, container_fetch_response
+
def test_update_dataset_in_folder(self):
ld = self._create_dataset_in_folder_in_library("ForUpdateDataset")
data = {'name': 'updated_name', 'file_ext': 'fastq', 'misc_info': 'updated_info', 'genome_build': 'updated_genome_build'}
@@ -301,6 +321,13 @@ class LibrariesApiTestCase(api.ApiTestCase, TestsDatasets):
)
return self._post("libraries/%s/contents" % library["id"], data=create_data)
+ def _create_subfolder(self, containing_folder_id):
+ create_data = dict(
+ description="new subfolder desc",
+ name="New Subfolder",
+ )
+ return self._post("folders/%s" % containing_folder_id, data=create_data)
+
def _create_dataset_in_folder_in_library(self, library_name):
library = self.library_populator.new_private_library(library_name)
folder_response = self._create_folder(library)
diff --git a/test/base/driver_util.py b/test/base/driver_util.py
index 920684a211a..92587939904 100644
--- a/test/base/driver_util.py
+++ b/test/base/driver_util.py
@@ -178,11 +178,13 @@ def setup_galaxy_config(
if tool_dependency_dir is None:
tool_dependency_dir = tempfile.mkdtemp(dir=tmpdir, prefix="tool_dependencies")
tool_data_table_config_path = _tool_data_table_config_path(default_tool_data_table_config_path)
- default_data_manager_config = 'config/data_manager_conf.xml.sample'
+ default_data_manager_config = None
for data_manager_config in ['config/data_manager_conf.xml', 'data_manager_conf.xml']:
if os.path.exists(data_manager_config):
default_data_manager_config = data_manager_config
- data_manager_config_file = "%s,test/functional/tools/sample_data_manager_conf.xml" % default_data_manager_config
+ data_manager_config_file = "test/functional/tools/sample_data_manager_conf.xml"
+ if default_data_manager_config is not None:
+ data_manager_config_file = "%s,%s" % (default_data_manager_config, data_manager_config_file)
master_api_key = get_master_api_key()
cleanup_job = 'never' if ("GALAXY_TEST_NO_CLEANUP" in os.environ or
"TOOL_SHED_TEST_NO_CLEANUP" in os.environ) else 'onsuccess'
@@ -203,8 +205,6 @@ def setup_galaxy_config(
tool_conf = "%s,%s" % (tool_conf, shed_tool_conf)
shed_tool_data_table_config = default_shed_tool_data_table_config
- if shed_tool_data_table_config is None:
- shed_tool_data_table_config = 'config/shed_tool_data_table_conf.xml'
config = dict(
admin_users='test@bx.psu.edu',
@@ -300,7 +300,7 @@ def _tool_data_table_config_path(default_tool_data_table_config_path=None):
if tool_data_table_config_path is None:
# ... otherise find whatever Galaxy would use as the default and
# the sample data for fucntional tests to that.
- default_tool_data_config = 'config/tool_data_table_conf.xml.sample'
+ default_tool_data_config = 'lib/galaxy/config/sample/tool_data_table_conf.xml.sample'
for tool_data_config in ['config/tool_data_table_conf.xml', 'tool_data_table_conf.xml']:
if os.path.exists(tool_data_config):
default_tool_data_config = tool_data_config
@@ -567,7 +567,7 @@ def build_galaxy_app(simple_kwargs):
"""
log.info("Galaxy database connection: %s", simple_kwargs["database_connection"])
simple_kwargs['global_conf'] = get_webapp_global_conf()
- simple_kwargs['global_conf']['__file__'] = "config/galaxy.yml.sample"
+ simple_kwargs['global_conf']['__file__'] = "lib/galaxy/config/sample/galaxy.yml.sample"
simple_kwargs = load_app_properties(
kwds=simple_kwargs
)
diff --git a/test/functional/tools/upload.py b/test/functional/tools/upload.py
index 6cf43a566b3..282421f9585 120000
--- a/test/functional/tools/upload.py
+++ b/test/functional/tools/upload.py
@@ -1 +1 @@
-../../../tools/data_source/upload.py
\ No newline at end of file
+../../../lib/galaxy/tools/bundled/data_source/upload.py
\ No newline at end of file
diff --git a/test/functional/tools/upload.xml b/test/functional/tools/upload.xml
index 3096f6a2d4c..684a91b47ee 120000
--- a/test/functional/tools/upload.xml
+++ b/test/functional/tools/upload.xml
@@ -1 +1 @@
-../../../tools/data_source/upload.xml
\ No newline at end of file
+../../../lib/galaxy/tools/bundled/data_source/upload.xml
\ No newline at end of file
diff --git a/test/integration/test_datatype_upload.py b/test/integration/test_datatype_upload.py
index 58e45b0bb55..46275580351 100644
--- a/test/integration/test_datatype_upload.py
+++ b/test/integration/test_datatype_upload.py
@@ -18,7 +18,7 @@ SCRIPT_DIRECTORY = os.path.abspath(os.path.dirname(__file__))
TEST_FILE_DIR = '%s/../../lib/galaxy/datatypes/test' % SCRIPT_DIRECTORY
TestData = collections.namedtuple('UploadDatatypesData', 'path datatype uploadable')
GALAXY_ROOT = os.path.abspath('%s/../../' % SCRIPT_DIRECTORY)
-DATATYPES_CONFIG = os.path.join(GALAXY_ROOT, 'config/datatypes_conf.xml.sample')
+DATATYPES_CONFIG = os.path.join(GALAXY_ROOT, 'lib/galaxy/config/sample/datatypes_conf.xml.sample')
PARENT_SNIFFER_MAP = {'fastqsolexa': 'fastq'}
diff --git a/test/integration/test_local_job_cancellation.py b/test/integration/test_local_job_cancellation.py
index abcaa0a1576..d01cea8bd2e 100644
--- a/test/integration/test_local_job_cancellation.py
+++ b/test/integration/test_local_job_cancellation.py
@@ -18,29 +18,53 @@ class LocalJobCancellationTestCase(integration_util.IntegrationTestCase):
super(LocalJobCancellationTestCase, self).setUp()
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
+ def setup_cat_data_and_sleep(self, history_id):
+ hda1 = self.dataset_populator.new_dataset(history_id, content="1 2 3")
+ running_inputs = {
+ "input1": {"src": "hda", "id": hda1["id"]},
+ "sleep_time": 240,
+ }
+ running_response = self.dataset_populator.run_tool(
+ "cat_data_and_sleep",
+ running_inputs,
+ history_id,
+ assert_ok=False,
+ ).json()
+ job_dict = running_response["jobs"][0]
+ return job_dict
+
+ def test_cancel_job_with_admin_message(self):
+ with self.dataset_populator.test_history() as history_id:
+ job_dict = self.setup_cat_data_and_sleep(history_id)
+ self.galaxy_interactor.wait_for(lambda: self._get("jobs/%s" % job_dict['id']).json()['state'] != 'running',
+ what="Wait for job to start running",
+ maxseconds=60)
+ app = self._app
+ sa_session = app.model.context.current
+ Job = app.model.Job
+ job = sa_session.query(Job).filter_by(tool_id="cat_data_and_sleep").order_by(Job.create_time.desc()).first()
+ # This is how the admin controller code cancels a job
+ job.job_stderr = 'admin cancelled job'
+ job.set_state(app.model.Job.states.DELETED_NEW)
+ sa_session.add(job)
+ sa_session.flush()
+ self.galaxy_interactor.wait_for(lambda: self._get("jobs/%s" % job_dict['id']).json()['state'] != 'error',
+ what="Wait for job to end in error",
+ maxseconds=60)
+
def test_kill_process(self):
"""
"""
with self.dataset_populator.test_history() as history_id:
- hda1 = self.dataset_populator.new_dataset(history_id, content="1 2 3")
- running_inputs = {
- "input1": {"src": "hda", "id": hda1["id"]},
- "sleep_time": 240,
- }
- running_response = self.dataset_populator.run_tool(
- "cat_data_and_sleep",
- running_inputs,
- history_id,
- assert_ok=False,
- ).json()
- job_dict = running_response["jobs"][0]
+ job_dict = self.setup_cat_data_and_sleep(history_id)
app = self._app
sa_session = app.model.context.current
external_id = None
state = False
+ Job = app.model.Job
- job = sa_session.query(app.model.Job).filter_by(tool_id="cat_data_and_sleep").one()
+ job = sa_session.query(Job).filter_by(tool_id="cat_data_and_sleep").order_by(Job.create_time.desc()).first()
# Not checking the state here allows the change from queued to running to overwrite
# the change from queued to deleted_new in the API thread - this is a problem because
# the job will still run. See issue https://github.com/galaxyproject/galaxy/issues/4960.
diff --git a/test/shed_functional/base/twilltestcase.py b/test/shed_functional/base/twilltestcase.py
index 33d2f80e87f..67d936106e3 100644
--- a/test/shed_functional/base/twilltestcase.py
+++ b/test/shed_functional/base/twilltestcase.py
@@ -521,10 +521,8 @@ class ShedTwillTestCase(FunctionalTestCase):
self.check_for_strings(strings_displayed, strings_not_displayed)
def browse_tool_shed(self, url, strings_displayed=None, strings_not_displayed=None):
- params = {
- 'tool_shed_url': url
- }
- self.visit_galaxy_url('/admin_toolshed/browse_tool_shed', params=params)
+ url = '/repository/browse_valid_categories'
+ self.visit_url(url)
self.check_for_strings(strings_displayed, strings_not_displayed)
def browse_tool_dependencies(self, strings_displayed=None, strings_not_displayed=None):
diff --git a/test/shed_functional/functional/test_1000_install_basic_repository.py b/test/shed_functional/functional/test_1000_install_basic_repository.py
index 4fc6d2223db..e44f61a2fcf 100644
--- a/test/shed_functional/functional/test_1000_install_basic_repository.py
+++ b/test/shed_functional/functional/test_1000_install_basic_repository.py
@@ -71,8 +71,6 @@ class BasicToolShedFeatures(ShedTwillTestCase):
def test_0010_browse_tool_sheds(self):
"""Browse the available tool sheds in this Galaxy instance."""
self.galaxy_login(email=common.admin_email, username=common.admin_username)
- self.visit_galaxy_url('/admin_toolshed/browse_tool_sheds')
- self.check_page_for_string('Embedded tool shed for functional tests')
self.browse_tool_shed(url=self.url, strings_displayed=['Test 0000 Basic Repository Features 1', 'Test 0000 Basic Repository Features 2'])
def test_0015_browse_test_0000_category(self):
diff --git a/test/unit/datatypes/test_sniff.py b/test/unit/datatypes/test_sniff.py
index faf75443281..3217ae6aaf6 100644
--- a/test/unit/datatypes/test_sniff.py
+++ b/test/unit/datatypes/test_sniff.py
@@ -18,11 +18,10 @@ def assert_converts_to_1234_convert_sep2tabs(content, expected='1\t2\n3\t4\n'):
def assert_converts_to_1234_convert(content, block_size=1024):
- fname = get_test_fname('temp2.txt')
- with open(fname, 'w') as fh:
- fh.write(content)
- rval = convert_newlines(fname, tmp_prefix="gxtest", tmp_dir=tempfile.gettempdir(), block_size=block_size)
- actual_contents = open(fname).read()
+ with tempfile.NamedTemporaryFile(delete=False, mode='w') as tf:
+ tf.write(content)
+ rval = convert_newlines(tf.name, tmp_prefix="gxtest", tmp_dir=tempfile.gettempdir(), block_size=block_size)
+ actual_contents = open(tf.name).read()
assert '1 2\n3 4\n' == actual_contents, actual_contents
assert rval == (2, None), "rval != %s for %s" % (rval, content)
diff --git a/test/unit/jobs/test_job_configuration.py b/test/unit/jobs/test_job_configuration.py
index 9aec01cb6d4..33acdf18607 100644
--- a/test/unit/jobs/test_job_configuration.py
+++ b/test/unit/jobs/test_job_configuration.py
@@ -13,8 +13,8 @@ from galaxy.web_stack import ApplicationStack, UWSGIApplicationStack
# File would be slightly more readable if contents were embedded directly, but
# there are advantages to testing the documentation/examples.
-SIMPLE_JOB_CONF = os.path.join(os.path.dirname(__file__), "..", "..", "..", "config", "job_conf.xml.sample_basic")
-ADVANCED_JOB_CONF = os.path.join(os.path.dirname(__file__), "..", "..", "..", "config", "job_conf.xml.sample_advanced")
+SIMPLE_JOB_CONF = os.path.join(os.path.dirname(__file__), "..", "..", "..", "lib", "galaxy", "config", "sample", "job_conf.xml.sample_basic")
+ADVANCED_JOB_CONF = os.path.join(os.path.dirname(__file__), "..", "..", "..", "lib", "galaxy", "config", "sample", "job_conf.xml.sample_advanced")
ADVANCED_JOB_CONF_YAML = os.path.join(os.path.dirname(__file__), "job_conf.sample_advanced.yml")
CONDITIONAL_RUNNER_JOB_CONF = os.path.join(os.path.dirname(__file__), "conditional_runners_job_conf.xml")
HANDLER_TEMPLATE_JOB_CONF = os.path.join(os.path.dirname(__file__), "handler_template_job_conf.xml")
diff --git a/test/unit/queue_worker/conftest.py b/test/unit/queue_worker/conftest.py
index 603265ebcc8..2e867eec1a4 100644
--- a/test/unit/queue_worker/conftest.py
+++ b/test/unit/queue_worker/conftest.py
@@ -3,6 +3,11 @@ import tempfile
import pytest
+try:
+ import psycopg2
+except ImportError:
+ psycopg2 = None
+
from galaxy.util import which
from ..unittest_utils import galaxy_mock
@@ -57,6 +62,8 @@ def database_app(request):
if request.param == 'postgres_app':
if not which('initdb'):
pytest.skip("initdb must be on PATH for postgresql fixture")
+ if not psycopg2:
+ pytest.skip("psycopg2 must be installed for postgresql fixture")
if request.param == 'sqlite_rabbitmq_app':
if not os.environ.get('GALAXY_TEST_AMQP_INTERNAL_CONNECTION'):
pytest.skip("rabbitmq tests will be skipped if GALAXY_TEST_AMQP_INTERNAL_CONNECTION env var is unset")
diff --git a/test/unit/test_auth.py b/test/unit/test_auth.py
new file mode 100644
index 00000000000..557de59cb13
--- /dev/null
+++ b/test/unit/test_auth.py
@@ -0,0 +1,18 @@
+from galaxy.auth.providers.alwaysreject import AlwaysReject
+from galaxy.auth.providers.localdb import LocalDB
+from galaxy.model import User
+
+
+def test_alwaysreject():
+ t = AlwaysReject()
+ assert t.authenticate('testmail', 'testuser', 'secret', dict()) == (None, '', '')
+
+
+def test_localdb():
+ user = User(email='testmail', username='tester')
+ user.set_password_cleartext('test')
+ t = LocalDB()
+ reject = t.authenticate_user(user, 'wrong', {'redact_username_in_logs': False})
+ accept = t.authenticate_user(user, 'test', {'redact_username_in_logs': False})
+ assert reject is False
+ assert accept is True
diff --git a/test/unit/test_containers.py b/test/unit/test_containers.py
new file mode 100644
index 00000000000..02e30a462e0
--- /dev/null
+++ b/test/unit/test_containers.py
@@ -0,0 +1,8 @@
+import galaxy.containers
+
+
+def test_dummy():
+ t = galaxy.containers.parse_containers_config('')
+ assert t == {'_default_': {'type': 'docker'}}
+ s = galaxy.containers.docker_model.DockerAttributeContainer()
+ assert s.members == frozenset([])
diff --git a/test/unit/tools/test_toolbox.py b/test/unit/tools/test_toolbox.py
index f16b565e693..e592f8e43d2 100644
--- a/test/unit/tools/test_toolbox.py
+++ b/test/unit/tools/test_toolbox.py
@@ -9,11 +9,11 @@ import routes
from six import string_types
from galaxy import model
+from galaxy.config_watchers import ConfigWatchers
from galaxy.model import tool_shed_install
from galaxy.model.tool_shed_install import mapping
from galaxy.tools import ToolBox
from galaxy.tools.cache import ToolCache
-from galaxy.webapps.galaxy.config_watchers import ConfigWatchers
from .test_tool_loader import (
SIMPLE_MACRO,
SIMPLE_TOOL_WITH_MACRO
diff --git a/test/unit/unittest_utils/galaxy_mock.py b/test/unit/unittest_utils/galaxy_mock.py
index b1254494041..6feaab340ba 100644
--- a/test/unit/unittest_utils/galaxy_mock.py
+++ b/test/unit/unittest_utils/galaxy_mock.py
@@ -113,6 +113,7 @@ class MockAppConfig(Bunch):
self.security = idencoding.IdEncodingHelper(id_secret='6e46ed6483a833c100e68cc3f1d0dd76')
self.database_connection = kwargs.get('database_connection', "sqlite:///:memory:")
self.use_remote_user = kwargs.get('use_remote_user', False)
+ self.data_dir = '/tmp'
self.file_path = '/tmp'
self.jobs_directory = '/tmp'
self.new_file_path = '/tmp'
@@ -155,6 +156,12 @@ class MockAppConfig(Bunch):
def config_dict(self):
return self.dict()
+ def __getattr__(self, name):
+ # Handle the automatic config file _set options
+ if name.endswith('_file_set'):
+ return False
+ return super(MockAppConfig, self).__getattr__(name)
+
class MockWebapp(object):
diff --git a/tox.ini b/tox.ini
index 0aec466cf97..f06e5e66ab7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,6 +10,7 @@ commands =
lint: bash .ci/flake8_wrapper.sh
unit: bash run_tests.sh -u
whitelist_externals = bash
+passenv = CI
setenv =
py{35,36,37}-first_startup: GALAXY_VIRTUAL_ENV=.venv3
unit: GALAXY_VIRTUAL_ENV={envdir}
|