Skip to content

Commit

Permalink
Merge branch 'dev' into topic/lint-context
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias authored Jan 5, 2022
2 parents 0473ac2 + cb6e00f commit efc8d52
Show file tree
Hide file tree
Showing 513 changed files with 15,431 additions and 6,478 deletions.
24 changes: 20 additions & 4 deletions .ci/first_startup.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
#!/bin/sh
case "$1" in
galaxy|"")
SCRIPT=./run.sh
PORT=8080
LOGFILE=galaxy.log
;;
reports)
SCRIPT=./run_reports.sh
PORT=9001
LOGFILE=reports_webapp.log
;;
*)
echo "ERROR: Unrecognized app"
exit 1
;;
esac
TRIES=120
URL=http://localhost:8080
URL=http://localhost:$PORT
EXIT_CODE=1
i=0
echo "Testing for correct startup:"
bash run.sh --daemon && \
$SCRIPT --daemon && \
while [ "$i" -le $TRIES ]; do
curl --max-time 1 "$URL" && EXIT_CODE=0 && break
sleep 1
i=$((i + 1))
done
bash run.sh --skip-wheels --stop-daemon
$SCRIPT --skip-wheels --stop-daemon
echo "exit code:$EXIT_CODE, showing startup log:"
cat galaxy.log
cat "$LOGFILE"
exit $EXIT_CODE
15 changes: 3 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ variables:
jobs:
get_code:
docker:
- image: circleci/python:3.6
- image: circleci/python:3.7
<<: *set_workdir
steps:
# Replace standard code checkout with shallow clone to speed things up.
Expand Down Expand Up @@ -85,26 +85,17 @@ jobs:
- ~/repo
validate_test_tools:
docker:
- image: circleci/python:3.6
- image: circleci/python:3.7
<<: *set_workdir
steps:
- *restore_repo_cache
- run: sudo apt-get update
- run: sudo apt-get install -y libxml2-utils
- *install_tox
- run: tox -e validate_test_tools
test_galaxy_release:
docker:
- image: circleci/python:3.6
<<: *set_workdir
steps:
- *restore_repo_cache
- *install_tox
- *install_deb_reqs
- run: tox -e test_galaxy_release
test_galaxy_packages:
docker:
- image: circleci/python:3.6
- image: circleci/python:3.7
<<: *set_workdir
steps:
- *restore_repo_cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6']
python-version: ['3.7']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/first_startup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.9']
python-version: ['3.7', '3.10']
webserver: ['uwsgi']
include:
- python-version: '3.9'
- python-version: '3.10'
webserver: 'dev'
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.9']
python-version: ['3.7', '3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/osx_startup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
id: pip-cache
with:
path: ~/Library/Caches/pip
# scripts/common_startup.sh creates a conda env for Galaxy containing Python 3.6
key: pip-cache-3.6-${{ hashFiles('galaxy root/requirements.txt') }}
# scripts/common_startup.sh creates a conda env for Galaxy containing Python 3.7
key: pip-cache-3.7-${{ hashFiles('galaxy root/requirements.txt') }}
- name: Cache tox env
uses: actions/cache@v2
with:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/reports_startup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Reports startup
on:
push:
paths-ignore:
- 'doc/**'
pull_request:
paths-ignore:
- 'doc/**'
env:
YARN_INSTALL_OPTS: --frozen-lockfile
concurrency:
group: reports-startup-${{ github.ref }}
cancel-in-progress: true
jobs:

test:
name: Reports startup test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.10']
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
with:
path: 'galaxy root'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get full Python version
id: full-python-version
shell: bash
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
- name: Cache pip dir
uses: actions/cache@v1
id: pip-cache
with:
path: ~/.cache/pip
key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('galaxy root/requirements.txt') }}
- name: Cache tox env
uses: actions/cache@v2
with:
path: .tox
key: tox-cache-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-reports-startup
- uses: mvdbeek/gha-yarn-cache@master
with:
yarn-lock-file: 'galaxy root/client/yarn.lock'
- name: Install tox
run: pip install tox
- name: run tests
run: tox -e reports_startup
working-directory: 'galaxy root'
25 changes: 25 additions & 0 deletions .github/workflows/test_galaxy_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test Galaxy release script
on:
push:
paths:
- lib/galaxy/version.py
- scripts/release.sh
- test/release.sh
pull_request:
paths:
- lib/galaxy/version.py
- scripts/release.sh
- test/release.sh
concurrency:
group: test-galaxy-release-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run tests
run: ./test/release.sh
7 changes: 6 additions & 1 deletion .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.9']
python-version: ['3.7', '3.10']
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -47,3 +47,8 @@ jobs:
- name: Run tests
run: tox -e unit
working-directory: 'galaxy root'
- uses: actions/upload-artifact@v2
if: failure()
with:
name: Unit test results (${{ matrix.python-version }})
path: 'galaxy root/run_unit_tests.html'
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ VENV?=.venv
IN_VENV=if [ -f "$(VENV)/bin/activate" ]; then . "$(VENV)/bin/activate"; fi;
RELEASE_CURR:=22.01
RELEASE_UPSTREAM:=upstream
TARGET_BRANCH=$(RELEASE_UPSTREAM)/dev
CONFIG_MANAGE=$(IN_VENV) python lib/galaxy/config/config_manage.py
PROJECT_URL?=https://github.com/galaxyproject/galaxy
DOCS_DIR=doc
Expand Down Expand Up @@ -37,6 +38,9 @@ docs-develop: ## Fast doc generation and more warnings (for development)
setup-venv:
if [ ! -f $(VENV)/bin/activate ]; then bash scripts/common_startup.sh --dev-wheels; fi

diff-format:
$(IN_VENV) darker -r $(TARGET_BRANCH)

list-dependency-updates: setup-venv
$(IN_VENV) pip list --outdated --format=columns

Expand Down Expand Up @@ -141,7 +145,7 @@ $(CWL_TARGETS):

generate-cwl-conformance-tests: $(CWL_TARGETS) ## Initialise CWL conformance tests

clean-cwl-conformance-tests: # Clean CWL conformance tests
clean-cwl-conformance-tests: ## Clean CWL conformance tests
for f in $(CWL_TARGETS); do \
if [ $$(basename "$$f") = conformance_tests.yaml ]; then \
rm -rf $$(dirname "$$f"); \
Expand Down
5 changes: 0 additions & 5 deletions client/src/bundleEntries.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export { TracksterUI } from "viz/trackster";
import Circster from "viz/circster";
export { PhylovizView as phyloviz } from "viz/phyloviz";
export { SweepsterVisualization, SweepsterVisualizationView } from "viz/sweepster";
import GalaxyLibrary from "galaxy.library";
export { createTabularDatasetChunkedView } from "mvc/dataset/data";
import { HistoryCollection } from "mvc/history/history-model";
export { History } from "mvc/history/history-model";
Expand All @@ -44,10 +43,6 @@ export function circster(options) {
new Circster.GalaxyApp(options);
}

export function library(options) {
new GalaxyLibrary.GalaxyApp(options);
}

export function multiHistory(options) {
const histories = new HistoryCollection([], {
includeDeleted: options.includingDeleted,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/CopyToClipboard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<font-awesome-icon :title="title" :icon="['far', 'copy']" @click="copy(text, message)" />
<font-awesome-icon class="cursor-pointer" :title="title" :icon="['far', 'copy']" @click="copy(text, message)" />
</template>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import flushPromises from "flush-promises";

const localVue = getLocalVue();

jest.mock("components/History/caching");
jest.mock("components/providers/History/caching");

function buildWrapper(conversion_disable = false) {
return mount(DatasetAttributes, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import datasetResponse from "./testData/datasetResponse";
import flushPromises from "flush-promises";
import moment from "moment";

jest.mock("components/History/caching");
jest.mock("components/providers/History/caching");
const HDA_ID = "FOO_HDA_ID";

const mockDatasetProvider = {
Expand Down
65 changes: 65 additions & 0 deletions client/src/components/FilesDialog/FilesDialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import axios from "axios";
import BootstrapVue from "bootstrap-vue";

import {
ftpId,
rootId,
directoryId,
subDirectoryId,
Expand All @@ -19,6 +20,7 @@ import {
directory2RecursiveResponse,
directory1Response,
subsubdirectoryResponse,
someErrorText,
} from "./testingData";
import { selectionStates } from "components/SelectionDialog/selectionStates";

Expand All @@ -44,6 +46,11 @@ const initComponent = async (props) => {
axiosMock.onGet(path).reply(200, response);
}

axiosMock.onGet("/api/remote_files?target=gxfiles://empty-dir").reply(404, {
err_msg: someErrorText,
err_code: 404,
});

const wrapper = shallowMount(FilesDialog, {
localVue,
propsData: props,
Expand Down Expand Up @@ -193,6 +200,43 @@ describe("FilesDialog, file mode", () => {
const rootNode = utils.getRenderedDirectory(rootId);
expect(rootNode._rowVariant).toBe(selectionStates.selected);
});

it("should show ftp helper only in ftp directory", async () => {
// open some other directory than ftp
await utils.open_root_folder();
// check that ftp helper is not visible
expect(wrapper.vm.showFTPHelper).toBe(false);
expect(wrapper.find("#helper").exists()).toBe(false);
// back to root folder
await utils.navigateBack();

// open ftp directory
await utils.openDirectory(ftpId);
// check that ftp helper is visible
expect(wrapper.vm.showFTPHelper).toBe(true);
expect(wrapper.find("#helper").exists()).toBe(true);
});

it("should show loading error and can return back", async () => {
expect(wrapper.vm.errorMessage).toBeNull();

// open directory with error
await utils.openDirectory("empty-dir");
// assert that error message is set and showed
expect(wrapper.vm.errorMessage).toBe(someErrorText);
expect(wrapper.html()).toContain(someErrorText);

// assert that OK button is disabled
expect(wrapper.vm.hasValue).toBe(false);

// back to the root folder
await wrapper.find("#back-btn").trigger("click");
await flushPromises();
expect(wrapper.vm.items.length).toBe(rootResponse.length);

// assert that OK button is disabled
expect(wrapper.vm.hasValue).toBe(false);
});
});

describe("FilesDialog, directory mode", () => {
Expand Down Expand Up @@ -238,6 +282,27 @@ describe("FilesDialog, directory mode", () => {
//should close modal
expect(wrapper.vm.modalShow).toBe(false);
});

it("should show loading error and can return back", async () => {
expect(wrapper.vm.errorMessage).toBeNull();

// open directory with error
await utils.openDirectory("empty-dir");
// assert that error message is set and showed
expect(wrapper.vm.errorMessage).toBe(someErrorText);
expect(wrapper.html()).toContain(someErrorText);

// assert that OK button is disabled
expect(wrapper.vm.hasValue).toBe(false);

// back to the root folder
await wrapper.find("#back-btn").trigger("click");
await flushPromises();
expect(wrapper.vm.items.length).toBe(rootResponse.length);

// assert that OK button is disabled
expect(wrapper.vm.hasValue).toBe(false);
});
});

/** Util methods **/
Expand Down
Loading

0 comments on commit efc8d52

Please sign in to comment.