Skip to content

Commit 048cf05

Browse files
committed
Merge pull request #104 from josalmi/disable-local-test-action
Exercise attribute 'Run tests locally action enabled' implementation
2 parents 0a64f26 + 62e0a0d commit 048cf05

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tmc-plugin/src/fi/helsinki/cs/tmc/actions/RunTestsLocallyAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected String iconResource() {
6464
@Override
6565
protected boolean enabledFor(Exercise exercise) {
6666
// Overridden to not care about the deadline
67-
return exercise.isReturnable();
67+
return exercise.isRunTestsLocallyActionEnabled() && exercise.isReturnable();
6868
}
6969

7070
@Override

tmc-plugin/src/fi/helsinki/cs/tmc/data/Exercise.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public class Exercise implements Serializable {
6060
@SerializedName("code_review_requests_enabled")
6161
private boolean codeReviewRequestsEnabled;
6262

63+
@SerializedName("run_tests_locally_action_enabled")
64+
private boolean runTestsLocallyActionEnabled = true;
65+
6366
public enum ValgrindStrategy {
6467
@SerializedName("")
6568
NONE,
@@ -273,6 +276,14 @@ public void setCodeReviewRequestsEnabled(boolean codeReviewRequestsEnabled) {
273276
this.codeReviewRequestsEnabled = codeReviewRequestsEnabled;
274277
}
275278

279+
public boolean isRunTestsLocallyActionEnabled() {
280+
return runTestsLocallyActionEnabled;
281+
}
282+
283+
public void setRunTestsLocallyActionEnabled(boolean runTestsLocallyActionEnabled) {
284+
this.runTestsLocallyActionEnabled = runTestsLocallyActionEnabled;
285+
}
286+
276287
@Override
277288
public String toString() {
278289
return name;

0 commit comments

Comments
 (0)