Comments (3)
An update:
I found in Gradle CLI docs that you can specify the test classes:
gradle test --tests MyTestClass
But If there is a compilation problem in ANY of the tests, the score is zero.
Only if all tests compile, each of them get their respective points.
Is there a way to easily fix this, perhaps in Gradle or Actions config?
from autograding.
I'm no Gradle expert, but I had a similar issue in the past and used the sourceSets
attribute to exclude all classes that were not required for a given test. For example:
task test_constructor (type: Test) {
filter.includeTestsMatching "ConstructorTest"
}
// other test tasks here
// ....
sourceSets {
if (project.gradle.startParameter.taskNames.contains("test_constructor")) {
test.java.exclude '**/LotsOfGuessesTest*'
test.java.exclude '**/TestMain*'
test.java.exclude '**/TestMainLoop*'
sourceSets.main.java.excludes = ['Main*']
}
else if (project.gradle.startParameter.taskNames.contains("test_loser")) {
test.java.exclude '**/TestMain*'
test.java.exclude '**/TestMainLoop*'
sourceSets.main.java.excludes = ['Main*']
}
else if (project.gradle.startParameter.taskNames.contains("test_lots_of_guesses")) {
test.java.exclude '**/TestMain*'
test.java.exclude '**/TestMainLoop*'
sourceSets.main.java.excludes = ['Main*']
}
else if (project.gradle.startParameter.taskNames.contains("test_main")) {
test.java.exclude '**/TestMainLoop*'
}
}
Then, in my autograding.json file I call the tests one by one. To call the "constructor" test from the Gradle snippet above for instance, the test is:
{
"name": "Test constructors",
"setup": "",
"run": "timeout 60 gradle test_constructor",
"input": "",
"output": "",
"comparison": "included",
"timeout": 1,
"points": 20
}
I hope this helps.
from autograding.
from autograding.
Related Issues (20)
- Error : File not found: '/home/runner/work/_actions/education/autograding/v1/./dist/index.js' HOT 3
- Bug: Recurring issue with the autograding process in GitHub Actions for GitHub Classroom after today's release HOT 12
- Achieving finer granularity HOT 1
- Request for Support for Partial Grading based on Passed Test Cases HOT 1
- Autograding with points stops working if any tests are edited HOT 13
- Support for variables in autograding.json
- debug flag
- quiet flag for tests
- override/configure shell
- pre-conditions fΓΌr tests
- output checks should support stdout + stderr
- please add readme HOT 2
- Setting points via other actions
- Auto-grading Support for Scala HOT 2
- Node 12 Deprecation HOT 5
- Autograding action not able to read GitHub Secrets (Actions) HOT 6
- Unable to run command test for a go program HOT 1
- set-output command is deprecated warning when running education/autograding action
- Need help with autograding HTML files. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autograding.