@@ -693,11 +693,6 @@ pub async fn queue_rebuilds(
693
693
SELECT
694
694
c.name,
695
695
r.version,
696
- (
697
- SELECT MAX(b.rustc_nightly_date)
698
- FROM builds AS b
699
- WHERE b.rid = r.id AND b.rustc_nightly_date IS NOT NULL
700
- ) AS rustc_nightly_date,
701
696
(
702
697
SELECT MAX(COALESCE(b.build_finished, b.build_started))
703
698
FROM builds AS b
@@ -709,12 +704,8 @@ pub async fn queue_rebuilds(
709
704
WHERE
710
705
r.rustdoc_status = TRUE
711
706
) as i
712
- WHERE i.rustc_nightly_date < $1
713
707
ORDER BY i.last_build_attempt ASC
714
- LIMIT $2" ,
715
- config
716
- . rebuild_up_to_date
717
- . expect( "config.rebuild_up_to_date not set" ) ,
708
+ LIMIT $1" ,
718
709
rebuilds_to_queue,
719
710
)
720
711
. fetch ( & mut * conn) ;
@@ -741,46 +732,14 @@ mod tests {
741
732
use crate :: test:: FakeBuild ;
742
733
743
734
use super :: * ;
744
- use chrono:: { NaiveDate , Utc } ;
735
+ use chrono:: Utc ;
745
736
use std:: time:: Duration ;
746
737
747
- #[ test]
748
- fn test_dont_rebuild_when_new ( ) {
749
- crate :: test:: async_wrapper ( |env| async move {
750
- env. override_config ( |config| {
751
- config. max_queued_rebuilds = Some ( 100 ) ;
752
- config. rebuild_up_to_date = Some ( NaiveDate :: from_ymd_opt ( 2020 , 1 , 1 ) . unwrap ( ) ) ;
753
- } ) ;
754
-
755
- env. fake_release ( )
756
- . await
757
- . name ( "foo" )
758
- . version ( "0.1.0" )
759
- . builds ( vec ! [
760
- FakeBuild :: default ( )
761
- . rustc_version( "rustc 1.84.0-nightly (e7c0d2750 2020-10-15)" ) ,
762
- ] )
763
- . create ( )
764
- . await ?;
765
-
766
- let build_queue = env. async_build_queue ( ) . await ;
767
- assert ! ( build_queue. queued_crates( ) . await ?. is_empty( ) ) ;
768
-
769
- let mut conn = env. async_db ( ) . await . async_conn ( ) . await ;
770
- queue_rebuilds ( & mut conn, & env. config ( ) , & build_queue) . await ?;
771
-
772
- assert ! ( build_queue. queued_crates( ) . await ?. is_empty( ) ) ;
773
-
774
- Ok ( ( ) )
775
- } )
776
- }
777
-
778
738
#[ test]
779
739
fn test_rebuild_when_old ( ) {
780
740
crate :: test:: async_wrapper ( |env| async move {
781
741
env. override_config ( |config| {
782
742
config. max_queued_rebuilds = Some ( 100 ) ;
783
- config. rebuild_up_to_date = Some ( NaiveDate :: from_ymd_opt ( 2024 , 1 , 1 ) . unwrap ( ) ) ;
784
743
} ) ;
785
744
786
745
env. fake_release ( )
@@ -815,7 +774,6 @@ mod tests {
815
774
crate :: test:: async_wrapper ( |env| async move {
816
775
env. override_config ( |config| {
817
776
config. max_queued_rebuilds = Some ( 1 ) ;
818
- config. rebuild_up_to_date = Some ( NaiveDate :: from_ymd_opt ( 2024 , 1 , 1 ) . unwrap ( ) ) ;
819
777
} ) ;
820
778
821
779
let build_queue = env. async_build_queue ( ) . await ;
@@ -858,7 +816,6 @@ mod tests {
858
816
crate :: test:: async_wrapper ( |env| async move {
859
817
env. override_config ( |config| {
860
818
config. max_queued_rebuilds = Some ( 1 ) ;
861
- config. rebuild_up_to_date = Some ( NaiveDate :: from_ymd_opt ( 2024 , 1 , 1 ) . unwrap ( ) ) ;
862
819
} ) ;
863
820
864
821
let build_queue = env. async_build_queue ( ) . await ;
0 commit comments