Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend: FakeCanvasIntegration needs to provide a starter TestStudent #492

Open
frozenfrank opened this issue Nov 26, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@frozenfrank
Copy link
Contributor

frozenfrank commented Nov 26, 2024

Overview

Running the autograder with --use-canvas false leads to a null TestStudent which breaks the AutoGrader. The FakeCanvasIntegration should be able to provide a starter value that does some good.

Root Issues in Source Code

/// src/main/java/edu/byu/cs/service/AdminService.java
    public static User updateTestStudent() throws CanvasException, DataAccessException {
        User latestTestStudent = CanvasService.getCanvasIntegration().getTestStudent(); // This returns `null`

        // ...

            if (user == null) {
                user = latestTestStudent;
                userDao.insertUser(latestTestStudent); // Error is thrown here
            } else {
                userDao.setRepoUrl(user.netId(), latestTestStudent.repoUrl());
                userDao.setCanvasUserId(user.netId(), latestTestStudent.canvasUserId());
            }
    }
/// src/main/java/edu/byu/cs/canvas/FakeCanvasIntegration.java
    @Override
    public User getTestStudent() {
        return null; // ISSUE! Prevents the project from doing anything meaningful
    }

Symptomatic Error

10:53:12.008 ERROR edu.byu.cs.service.AdminService -- Error updating user
edu.byu.cs.dataAccess.DataAccessException: Error inserting item into table user
	at edu.byu.cs.dataAccess.sql.helpers.SqlReader.insertItem(SqlReader.java:120)
	at edu.byu.cs.dataAccess.sql.UserSqlDao.insertUser(UserSqlDao.java:40)
	at edu.byu.cs.service.AdminService.updateTestStudent(AdminService.java:101)
	at edu.byu.cs.controller.AdminController.lambda$static$1(AdminController.java:43)
	at spark.RouteImpl$1.handle(RouteImpl.java:72)
	at spark.http.matching.Routes.execute(Routes.java:61)
	at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:134)
	at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1598)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: java.lang.NullPointerException: null
	at edu.byu.cs.dataAccess.sql.helpers.SqlReader.setValue(SqlReader.java:125)
	at edu.byu.cs.dataAccess.sql.helpers.SqlReader.insertItem(SqlReader.java:115)
	... 27 common frames omitted
@frozenfrank frozenfrank added the bug Something isn't working label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants