Skip to content

Commit

Permalink
Merge branch 'release_23.1' into release_23.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Dec 23, 2023
2 parents 4fa0403 + 687bcf9 commit 7105af4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
19 changes: 9 additions & 10 deletions lib/galaxy/datatypes/converters/interval_to_bgzip_converter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
<test>
<param name="input1" ftype="bed" value="droPer1.bed"/>
<output name="output1" ftype="bgzip" value="droPer1.bgzip" decompress="true">
<expand macro="assert_size" value="131"/>
<expand macro="assert_size" value="120"/>
</output>
<assert_command>
<has_text text="-k1,1 -k2,2n -k3,3n"/>
</assert_command>
</test>
<test>
<param name="input1" ftype="encodepeak" value="encode.broad.peak"/>
<output name="output1" ftype="bgzip">
<output name="output1" ftype="bgzip" decompress="true">
<expand macro="assert_size" value="143">
<has_text_matching expression="^#" negate="true"/>
</expand>
Expand All @@ -61,7 +61,7 @@
<test>
<param name="input1" ftype="gff" value="gff_filter_by_feature_count_out2.gff"/>
<output name="output1" ftype="bgzip" value="bgzip_filter_by_feature_count_out2.bgzip" decompress="true">
<expand macro="assert_size" value="638"/>
<expand macro="assert_size" value="3824"/>
</output>
<assert_command>
<has_text text="-k1,1 -k4,4n"/>
Expand All @@ -71,7 +71,7 @@
<test>
<param name="input1" ftype="interval" value="2.interval"/>
<output name="output1" ftype="bgzip" value="2.bgzip" decompress="true">
<expand macro="assert_size" value="208"/>
<expand macro="assert_size" value="501"/>
</output>
<assert_command>
<has_text text="-k1,1 -k2,2n -k3,3n"/>
Expand All @@ -80,10 +80,9 @@
<test>
<param name="input1" ftype="vcf" value="vcf_to_maf_in.vcf"/>
<output name="output1" ftype="bgzip" decompress="true">
<expand macro="assert_size" value="322">
<!-- will only work with https://github.com/galaxyproject/galaxy/pull/15085
<has_n_lines n="3"/>
<has_text_matching expression="^#" negate="true"/> -->
<expand macro="assert_size" value="507">
<has_n_lines n="5"/>
<has_text_matching expression="^#" negate="true"/>
</expand>
</output>
<assert_command>
Expand All @@ -92,9 +91,9 @@
</test>
<test>
<param name="input1" ftype="gtf" value="cufflinks_out1.gtf"/>
<output name="output1" ftype="bgzip" >
<output name="output1" ftype="bgzip" decompress="true">
<assert_contents>
<has_size value="270" delta="10" />
<has_size value="887"/>
</assert_contents>
</output>
<assert_command>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<param name="input1" ftype="vcf" value="vcf_to_maf_in.vcf"/>
<output name="output1" ftype="vcf_bgzip" value="vcf_bgzip_to_maf_in.vcf_bgzip" decompress="true">
<assert_contents>
<has_size value="717" delta="10"/>
<has_size value="1182"/>
</assert_contents>
</output>
</test>
Expand Down
4 changes: 3 additions & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11004,7 +11004,9 @@ def __repr__(self):
# See https://github.com/sqlalchemy/sqlalchemy/discussions/7638 for approach
session_partition = select(
GalaxySession,
func.row_number().over(order_by=GalaxySession.update_time, partition_by=GalaxySession.user_id).label("index"),
func.row_number()
.over(order_by=GalaxySession.update_time.desc(), partition_by=GalaxySession.user_id)
.label("index"),
).alias()
partitioned_session = aliased(GalaxySession, session_partition)
User.current_galaxy_session = relationship(
Expand Down
11 changes: 11 additions & 0 deletions test/unit/data/test_galaxy_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,17 @@ def _non_empty_flush(self):
session.add(lf)
session.flush()

def test_current_session(self):
user = model.User(email="[email protected]", password="password")
galaxy_session = model.GalaxySession()
galaxy_session.user = user
self.persist(user, galaxy_session)
assert user.current_galaxy_session == galaxy_session
new_galaxy_session = model.GalaxySession()
new_galaxy_session.user = user
self.persist(user, new_galaxy_session)
assert user.current_galaxy_session == new_galaxy_session

def test_flush_refreshes(self):
# Normally I don't believe in unit testing library code, but the behaviors around attribute
# states and flushing in SQL Alchemy is very subtle and it is good to have a executable
Expand Down

0 comments on commit 7105af4

Please sign in to comment.