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

release: v0.1.1 #11

Merged
merged 7 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
tmp

# Tests execution folder
tests_exec_dir/
tests-execution-directory/
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# 0.1.0 (2024-01-05)
## [0.1.1](https://github.com/upb-code-labs/tests-microservice/compare/v0.1.0...v0.1.1) (2024-01-06)


### Bug Fixes

* Increment tests execution time limit ([#10](https://github.com/upb-code-labs/tests-microservice/issues/10)) ([c164193](https://github.com/upb-code-labs/tests-microservice/commit/c1641933bc1386529c6565d107bb0bce7202208e))



# [0.1.0](https://github.com/upb-code-labs/tests-microservice/compare/48c8a14aea266e3a7748009bb5ba72e6043f2be7...v0.1.0) (2024-01-05)


### Features
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ air

This will start the tests micro-service and will watch for changes in the source code and restart the service automatically.

Additionally, you may want to generate a `.air.toml` file and add the `tests_exec_dir/` directory to the `exclude_dir` list in order to avoid restarting the service when the tests are executed, to do this, run the following command or refer to the [Air documentation](https://github.com/cosmtrek/air)
Additionally, you may want to generate a `.air.toml` file and add the `tests-execution-directory/` directory to the `exclude_dir` list in order to avoid restarting the service when the tests are executed, to do this, run the following command or refer to the [Air documentation](https://github.com/cosmtrek/air)

```bash
air init
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/upb-code-labs/tests-microservice/infrastructure/rabbitmq"
"github.com/upb-code-labs/tests-microservice/src/infrastructure/rabbitmq"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package application

import (
"github.com/upb-code-labs/tests-microservice/domain/definitions"
"github.com/upb-code-labs/tests-microservice/domain/dtos"
"github.com/upb-code-labs/tests-microservice/domain/entities"
"github.com/upb-code-labs/tests-microservice/infrastructure/static_files"
"github.com/upb-code-labs/tests-microservice/utils"
"github.com/upb-code-labs/tests-microservice/src/domain/definitions"
"github.com/upb-code-labs/tests-microservice/src/domain/dtos"
"github.com/upb-code-labs/tests-microservice/src/domain/entities"
"github.com/upb-code-labs/tests-microservice/src/infrastructure/static_files"
"github.com/upb-code-labs/tests-microservice/src/utils"
)

type SubmissionsUseCases struct{}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package definitions

import (
"github.com/upb-code-labs/tests-microservice/domain/dtos"
"github.com/upb-code-labs/tests-microservice/src/domain/dtos"
)

type LanguageTestsRunner interface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package definitions

import "github.com/upb-code-labs/tests-microservice/domain/dtos"
import "github.com/upb-code-labs/tests-microservice/src/domain/dtos"

type SubmissionStatusUpdatesQueueManager interface {
QueueUpdate(updateDTO *dtos.SubmissionStatusUpdateDTO) error
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "github.com/kelseyhightower/envconfig"
type Environment struct {
RabbitMQConnectionString string `split_words:"true" default:"amqp://rabbitmq:rabbitmq@localhost:5672/"`
StaticFilesMicroserviceAddress string `split_words:"true" default:"http://localhost:8081"`
TestsExecutionDirectory string `split_words:"true" default:"./tests_exec_dir"`
TestsExecutionDirectory string `split_words:"true" default:"./tests-execution-directory"`
}

var env *Environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"strings"
"time"

"github.com/upb-code-labs/tests-microservice/domain/dtos"
"github.com/upb-code-labs/tests-microservice/infrastructure"
"github.com/upb-code-labs/tests-microservice/src/domain/dtos"
"github.com/upb-code-labs/tests-microservice/src/infrastructure"
)

type JavaTestsRunner struct{}
Expand Down Expand Up @@ -180,7 +180,7 @@ func (javaTestsRunner *JavaTestsRunner) deleteArchives(submissionUUID string) er
}

func (javaTestsRunner *JavaTestsRunner) RunTests(submissionUUID string) (dto *dtos.TestResultDTO, err error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
defer cancel()

// Delete the submission directory at the end
Expand All @@ -195,7 +195,7 @@ func (javaTestsRunner *JavaTestsRunner) RunTests(submissionUUID string) (dto *dt

// Prepare the command
testAndBuildCommand := fmt.Sprintf(
"cd %s && mvn clean test",
"cd %s && timeout 1m mvn clean test",
submissionPath,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"

amqp "github.com/rabbitmq/amqp091-go"
"github.com/upb-code-labs/tests-microservice/infrastructure"
"github.com/upb-code-labs/tests-microservice/src/infrastructure"
)

var rabbitMQChannel *amqp.Channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"log"

amqp "github.com/rabbitmq/amqp091-go"
"github.com/upb-code-labs/tests-microservice/application"
"github.com/upb-code-labs/tests-microservice/domain/dtos"
"github.com/upb-code-labs/tests-microservice/domain/entities"
"github.com/upb-code-labs/tests-microservice/utils"
"github.com/upb-code-labs/tests-microservice/src/application"
"github.com/upb-code-labs/tests-microservice/src/domain/dtos"
"github.com/upb-code-labs/tests-microservice/src/domain/entities"
"github.com/upb-code-labs/tests-microservice/src/utils"
)

type SubmissionQueueMgr struct {
Expand Down Expand Up @@ -131,6 +131,9 @@ func (manager *SubmissionQueueMgr) processSubmission(msg amqp.Delivery) {
return
}

// Log message to console
log.Println("[RabbitMQ]: Received submission status update", submissionWork.SubmissionUUID)

// Send submission status update
statusDTO := &dtos.SubmissionStatusUpdateDTO{
SubmissionUUID: submissionWork.SubmissionUUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

amqp "github.com/rabbitmq/amqp091-go"
"github.com/upb-code-labs/tests-microservice/domain/dtos"
"github.com/upb-code-labs/tests-microservice/src/domain/dtos"
)

type SubmissionStatusUpdatesQueueMgr struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"io"
"net/http"

"github.com/upb-code-labs/tests-microservice/domain/dtos"
"github.com/upb-code-labs/tests-microservice/infrastructure"
"github.com/upb-code-labs/tests-microservice/src/domain/dtos"
"github.com/upb-code-labs/tests-microservice/src/infrastructure"
)

type StaticFilesManager struct{}
Expand Down
6 changes: 3 additions & 3 deletions utils/utils.go → src/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package utils
import (
"errors"

"github.com/upb-code-labs/tests-microservice/domain/definitions"
"github.com/upb-code-labs/tests-microservice/domain/dtos"
"github.com/upb-code-labs/tests-microservice/infrastructure/implementations"
"github.com/upb-code-labs/tests-microservice/src/domain/definitions"
"github.com/upb-code-labs/tests-microservice/src/domain/dtos"
"github.com/upb-code-labs/tests-microservice/src/infrastructure/implementations"
)

func GetTestRunnerByLanguageUUID(languageUUID string) (runner definitions.LanguageTestsRunner, err error) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.1.0"
"version": "0.1.1"
}
Loading