Skip to content

Repository files navigation

TesterDBS

A tool for automating the testing process for database assignments in the Database Technologies course at the Slovak University of Technology.

The tool takes a student's Docker container as input, creates a sandbox environment using Docker, and executes predefined testing scenarios consisting of HTTP requests and their expected responses. The output is a comparison of the actual responses generated by the student's image and the expected responses. The tool utilizes Docker and Redis for efficient processing.

Install

Application use these environments variables:

VariableDescriptionDefaultExample
BASE_URLBase URL of the application-https://tester-dbs.fiit.stuba.sk
ALLOWED_HOSTSAllowed hosts (Django Setting)-tester-dbs.fiit.stuba.sk
DATABASE_HOSTDatabase server location-docker.for.mac.localhost
DATABASE_NAMEDatabase name-tester
DATABASE_PASSWORDDatabase user passwordsuper-secure-password
DATABASE_PORTDatabase port54325432
DATABASE_USERDatabase user-tester
DJANGO_SETTINGS_MODULEDjango Settings Moduledbs_tester.settings.developmentdbs_tester.settings.production
REDIS_HOSTRedis hosthost.docker.internalhost.docker.internal
REDIS_DBRedis database00
REDIS_DBRedis database00
REDIS_DBRedis database00
SECRET_KEYDjango secret-ghp_asdqwjdsncvsdv
GITHUB_TOKENGitHub token-Secure-random-string-21
GITHUB_USERGitHub username-Sibyx
DBS_DOCKER_NETWORKDocker network for assignment containersdbsdbs

Docker

Dockerfile contains two targets which are pre-build and available on GitHub Container registry:

Example of configuration is present in compose.yml.

The containers require access to the Docker environment that's why you have to create volume, which maps a path to the Docker socket.

Repository contains an example of the systemd unit script in the conf/tester-dbs.service.

From source

We use poetry for dependency management and PostgreSQL 15 (10+ should be compatible) as a data storage (acquisition files are stored on the filesystem, not in the database). To set up instance with demo database follow these simple steps:

  1. Create python virtual environment (python -m venv venv)
  2. Enter environment (source venv/bin/activate)
  3. Install dependencies poetry install
  4. Create .env file according .env.example
  5. Execute migrations python manage.py migrate
  6. Create superuser using python manage.py createsuperuser or setup LDAP in auth_sources table

Docs

For more information check the docs directory.

The key concepts of this software are described in the blog post How We Built an Application to Test Student Docker Images for a Database Systems University Course.

This blog post was later extended and presented at Communication and Information Technologies (KIT) 2023 with the article Docker-Based Assignment Evaluations in E-Learning.


Made with ❤️ and ☕️ FIIT STU (c) 2022-2024

About

Web application used to assigment validation

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages