Elektroline Python testο
This project includes introduction test for Python developers. The point of it is to check ability to not only code in Python but also to problem solve, documentation reading and writing, test implementation and project maintenance. It shoots for the stars so donβt be scared.
You should start by reading the documentation! π
This project is based on our internal Python project template and thus it contains a lot of real stuff.
Requirementsο
Python 3.11 or greater
Installationο
The installation can be done with any of your favorite Python installation tool. Installation with Pip would be:
$ git clone https://gitlab.com/Cynerd/ell-python-test.git
$ pip install ell-python-test
Running testsο
This project contains basic tests in directory tests.
To run tests you have to use pytest. To run all tests just run it in the top level directory of the project. See the pytest documentation for more info.
Documentationο
The documentation is available in docs directory. You can build it using:
$ sphinx-build -b html docs docs-html
Introductionο
Our company decided that its about time we would have our own implementation of project clock tracking. The work in our company is split between different projects and development time consumption must be tracked.
The simple server was implemented and your primary task is to implement CLI client for developers to use, but to do that you unfortunately will have to modify server as well.
The communication between server and client is over Silicon Heaven RPC protocol. You can start the server and investigate its RPC API with SHVCli:
$ python -m ellclockin.server -vvv tests/server/ellclockin-server.ini
$ shvcli tcp://franta@localhost?shapass=00af70ce92fa1a0106b28f8909a6fe3e7d0ab1d5
> ls
.app .broker clockin
> clockin/
clockin> ls
workers projects
clockin> ls workers
self
clockin> ls projects
clockin> dir projects
dir ls new clockout
clockin> projects:new "test"
null
clockin> ls projects
test
clockin> projects/test:work
null
clockin> ls workers
self franta
clockin> workers/self:currentProject
"test"
clockin> workers/self:currentSeconds
18
clockin> workers/self:currentSeconds
21
clockin> projects:clockout
null
clockin> workers/self:currentProject
null
clockin> workers/self:currentSeconds
null
clockin> projects/test:workers
["franta"]
clockin> projects/test:worktime
31
clockin>
The concept is that workers start their work by calling work
method on
project they are going to work. Later they can switch to a different project
with the same method (worker can work only on one project at the time). To leave
the work worker must call ellclockin/projects:clockout
.
Checklistο
This is checklist of expected work you should do. It is not an issue if you are unable to do them all. If you get stuck on some step then try to workaround it instead of abandoning the whole ordeal.
Implement command line client for developers to use to clock-in and out. The design is up to you (you would be the user). The file ellclockin/__main__.py contains initial template for you to start. It must provide a way to start working on the project, switch project and clock-out.
Write user documentation for the tool.
Add query for the workerβs contributions in the project
Add retroactive clock-out of the workers (if you fail to clock-out).
Commit changes using Git in the meaningful steps with an appropriate commit comments.
Fork this project on Gitlab.com and submit pull request with your changes.
Ensure that Gitlab CI passes
Optional points for improving the database queries in ellclockin/server/database.py.