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

Configure GH Actions for running tests before merging into development branch #237

Merged
merged 15 commits into from
Dec 13, 2021

Conversation

KeremZaman
Copy link
Collaborator

  • Github workflow was created for running tests on each push and merge into development branch

NOTE: Please do not merge this request before PR #231 is merged because this branch is created from eventposts-search.

Kerem Zaman added 15 commits December 12, 2021 16:52
- Add filtering by query, player capacity, spectators capacity, number of players, number of spectators, location name, event date, creation date, duration of the event, sport type, event owner, age, coordinates, skill levels

- Make relative imports absolute
- Add unittests for event search functionality
- Configure test database
- Convert relative imports to absolute imports in serializers.py
- Add testing command to run tests before starting application
- Add wait_for_db script for backend service to wait until database is ready
test_filter_by_date was failing due to the default value of the date field in EventPost model. By quoting the related part about auto_now_add from django documentation:
" So even if you set a value for this field when creating the object, it will be ignored."

Since the dates specified for the sample events created for tests were ignored, date_by_filter test was failing. This bug would cause wrong event dates while user creating an event, it is fixed by changing default value to the time of the event creation.
- Add Github workflow to configure tests, set pushing to current branch as trigger for now
- Configure test database for Github workflow
The default working directory is already backend folder
Copy link
Collaborator

@berkaydoner berkaydoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, this configuration should work. I can also help you connect the frontend unit tests similarly, when we have some time.

@supiket supiket self-requested a review December 13, 2021 16:32
Copy link
Contributor

@supiket supiket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-written tests. Contribution to Github Actions looks great. And test database configurations in this PR is contributing to tests for comments & answers. Thank you for your effort.

backend/Dockerfile Show resolved Hide resolved
many=True).data

self.skill_between_2_4 = self.football_games

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test coverage looks great, I see pretty exhaustive tests here.

@KeremZaman KeremZaman merged commit 7318d20 into development Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants