Skip to content

Commit

Permalink
Merge branch 'dev-2.x' into board-alight-in-pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
miklcct committed Nov 26, 2024
2 parents 3f5d535 + 3a4753e commit 79d9457
Show file tree
Hide file tree
Showing 622 changed files with 15,864 additions and 5,058 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ on:
- master
- dev-1.x
- dev-2.x
env:
# Since version 3.9.0 of Maven it will automatically understand this environment variable.
# However, as of 2024-11 the latest versions of Ubuntu and Debian were on 3.8.8 so it will take some
# time until we can remove the $MAVEN_ARGS below.
MAVEN_ARGS: "--no-transfer-progress -Dstyle.color=always"

jobs:
build-linux:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,22 +52,29 @@ jobs:
# https://github.com/actions/runner-images/issues/1499
# we set nodePath and npmPath to skip downloading the node binary, which frequently times out
run: |
mvn --batch-mode jacoco:prepare-agent test jacoco:report -P prettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm
mvn --batch-mode package -Dmaven.test.skip -P prettierSkip
mvn $MAVEN_ARGS jacoco:prepare-agent test jacoco:report -P prettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm
mvn $MAVEN_ARGS package -Dmaven.test.skip -P prettierSkip
- name: Send coverage data to codecov.io
if: github.repository_owner == 'opentripplanner'
uses: codecov/codecov-action@v4
with:
files: target/site/jacoco/jacoco.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

- name: Upload test results to Codecov
# always upload test results, even when failed
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: "*TEST-*.xml"

- name: Deploy to Github Package Registry
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev-1.x' || github.ref == 'refs/heads/dev-2.x')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn --batch-mode deploy --settings maven-settings.xml -DskipTests -DGITHUB_REPOSITORY=$GITHUB_REPOSITORY -P prettierSkip -P deployGitHub
run: mvn $MAVEN_ARGS deploy --settings maven-settings.xml -DskipTests -DGITHUB_REPOSITORY=$GITHUB_REPOSITORY -P prettierSkip -P deployGitHub

build-windows:
timeout-minutes: 20
Expand All @@ -79,7 +92,7 @@ jobs:
- name: Configure Windows Pagefile
uses: al-cheb/[email protected]
- name: Run tests
run: mvn --batch-mode test -P prettierSkip
run: mvn $MAVEN_ARGS test -P prettierSkip

docs:
if: github.repository_owner == 'opentripplanner'
Expand Down Expand Up @@ -192,7 +205,7 @@ jobs:
distribution: temurin
cache: maven
- name: Compile Java code
run: mvn --batch-mode compile -DskipTests -P prettierSkip
run: mvn $MAVEN_ARGS compile -DskipTests -P prettierSkip

container-image:
if: github.repository_owner == 'opentripplanner' && github.event_name == 'push' && (github.ref == 'refs/heads/dev-2.x' || github.ref == 'refs/heads/master')
Expand Down Expand Up @@ -237,4 +250,4 @@ jobs:
MAVEN_SKIP_ARGS="-P prettierSkip -Dmaven.test.skip=true -Dmaven.source.skip=true"
mvn --batch-mode $MAVEN_SKIP_ARGS package com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_version
mvn $MAVEN_ARGS $MAVEN_SKIP_ARGS package com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_version
5 changes: 5 additions & 0 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
<artifactId>otp-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>otp-raptor</artifactId>
<version>${project.version}</version>
</dependency>

<!-- 3rd party dependencies -->
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions application/src/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/img/otp-logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OTP Debug Client</title>
<script type="module" crossorigin src="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/11/2024-11-04T12:49/assets/index-DPdUtdaa.js"></script>
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/11/2024-11-04T12:49/assets/index-CaBThmWm.css">
<script type="module" crossorigin src="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/11/2024-11-22T08:29/assets/index-CwmtYnAr.js"></script>
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/11/2024-11-22T08:29/assets/index-CaBThmWm.css">
</head>
<body>
<div id="root"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.opentripplanner.ext.flex;

import static org.opentripplanner.model.StopTime.MISSING_VALUE;

import org.opentripplanner._support.geometry.Polygons;
import org.opentripplanner.model.PickDrop;
import org.opentripplanner.model.StopTime;
import org.opentripplanner.transit.model._data.TimetableRepositoryForTest;
import org.opentripplanner.transit.model.site.RegularStop;
import org.opentripplanner.transit.model.site.StopLocation;
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.utils.time.TimeUtils;

public class FlexStopTimesForTest {
Expand All @@ -18,6 +18,8 @@ public class FlexStopTimesForTest {
.build();
private static final RegularStop REGULAR_STOP = TEST_MODEL.stop("stop").build();

private static final Trip TRIP = TimetableRepositoryForTest.trip("flex").build();

public static StopTime area(String startTime, String endTime) {
return area(AREA_STOP, endTime, startTime);
}
Expand All @@ -27,26 +29,74 @@ public static StopTime area(StopLocation areaStop, String endTime, String startT
stopTime.setStop(areaStop);
stopTime.setFlexWindowStart(TimeUtils.time(startTime));
stopTime.setFlexWindowEnd(TimeUtils.time(endTime));
stopTime.setTrip(TRIP);
return stopTime;
}

public static StopTime regularArrival(String arrivalTime) {
return regularStopTime(TimeUtils.time(arrivalTime), MISSING_VALUE);
/**
* Returns an invalid combination of a flex area and continuous stopping.
*/
public static StopTime areaWithContinuousStopping(String time) {
var st = area(time, time);
st.setFlexContinuousPickup(PickDrop.COORDINATE_WITH_DRIVER);
st.setFlexContinuousDropOff(PickDrop.COORDINATE_WITH_DRIVER);
return st;
}

public static StopTime regularStopTime(String arrivalTime, String departureTime) {
return regularStopTime(TimeUtils.time(arrivalTime), TimeUtils.time(departureTime));
/**
* Returns an invalid combination of a flex area and continuous pick up.
*/
public static StopTime areaWithContinuousPickup(String time) {
var st = area(time, time);
st.setFlexContinuousPickup(PickDrop.COORDINATE_WITH_DRIVER);
return st;
}

public static StopTime regularStopTime(int arrivalTime, int departureTime) {
/**
* Returns an invalid combination of a flex area and continuous drop off.
*/
public static StopTime areaWithContinuousDropOff(String time) {
var st = area(time, time);
st.setFlexContinuousDropOff(PickDrop.COORDINATE_WITH_DRIVER);
return st;
}

public static StopTime regularStop(String arrivalTime, String departureTime) {
return regularStop(TimeUtils.time(arrivalTime), TimeUtils.time(departureTime));
}

public static StopTime regularStop(String time) {
return regularStop(TimeUtils.time(time), TimeUtils.time(time));
}

public static StopTime regularStopWithContinuousStopping(String time) {
var st = regularStop(TimeUtils.time(time), TimeUtils.time(time));
st.setFlexContinuousPickup(PickDrop.COORDINATE_WITH_DRIVER);
st.setFlexContinuousDropOff(PickDrop.COORDINATE_WITH_DRIVER);
return st;
}

public static StopTime regularStopWithContinuousPickup(String time) {
var st = regularStop(TimeUtils.time(time), TimeUtils.time(time));
st.setFlexContinuousPickup(PickDrop.COORDINATE_WITH_DRIVER);
return st;
}

public static StopTime regularStopWithContinuousDropOff(String time) {
var st = regularStop(TimeUtils.time(time), TimeUtils.time(time));
st.setFlexContinuousDropOff(PickDrop.COORDINATE_WITH_DRIVER);
return st;
}

public static StopTime regularStop(int arrivalTime, int departureTime) {
var stopTime = new StopTime();
stopTime.setStop(REGULAR_STOP);
stopTime.setArrivalTime(arrivalTime);
stopTime.setDepartureTime(departureTime);
stopTime.setTrip(TRIP);
return stopTime;
}

public static StopTime regularDeparture(String departureTime) {
return regularStopTime(MISSING_VALUE, TimeUtils.time(departureTime));
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.opentripplanner.ext.flex.FlexStopTimesForTest.area;
import static org.opentripplanner.ext.flex.FlexStopTimesForTest.regularStopTime;
import static org.opentripplanner.ext.flex.FlexStopTimesForTest.regularStop;
import static org.opentripplanner.street.model._data.StreetModelForTest.V1;
import static org.opentripplanner.street.model._data.StreetModelForTest.V2;
import static org.opentripplanner.transit.model._data.TimetableRepositoryForTest.id;
Expand All @@ -19,9 +19,9 @@ class ScheduledFlexPathCalculatorTest {
.of(id("123"))
.withStopTimes(
List.of(
regularStopTime("10:00", "10:01"),
regularStop("10:00", "10:01"),
area("10:10", "10:20"),
regularStopTime("10:25", "10:26"),
regularStop("10:25", "10:26"),
area("10:40", "10:50")
)
)
Expand Down
Loading

0 comments on commit 79d9457

Please sign in to comment.