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

Run tests against a real server, not mock data #165

Merged
merged 2 commits into from
May 26, 2023

Conversation

oyvindhagberg
Copy link
Contributor

This commit does the following:

  • Removes "playback" functionality from mocktraffic.py and renames the whole thing to a more appropriate name recordhttp.py
  • Changes the format of recorded output slightly, now the whole file is valid json. Updates testsuite-result.json accordingly.
  • Makes a few small changes to testsuite
  • Adds a docker-compose-file to be used when running the tests
  • Adds a shell script that runs the tests and compares api calls and output with a previously recorded file
  • Moves everything related to CI into a new folder
  • Modifies the workflow to use the aforementioned shell script

This commit does the following:
- Removes "playback" functionality from mocktraffic.py and renames the
  whole thing to a more appropriate name recordhttp.py
- Changes the format of recorded output slightly, now the whole file is
  valid json. Updates testsuite-result.json accordingly.
- Makes a few small changes to testsuite
- Adds a docker-compose-file to be used when running the tests
- Adds a shell script that runs the testsuite and compares output
- Moves everything related to CI into a new folder
- Modifies the workflow to use the aforementioned shell script
@oyvindhagberg oyvindhagberg added the enhancement New feature or request label May 23, 2023
@oyvindhagberg oyvindhagberg self-assigned this May 23, 2023
@oyvindhagberg oyvindhagberg marked this pull request as draft May 23, 2023 15:22
ci/docker-compose.yml Show resolved Hide resolved
ci/run_testsuite_and_record.sh Show resolved Hide resolved
mreg_cli/recordhttp.py Outdated Show resolved Hide resolved
mreg_cli/recordhttp.py Outdated Show resolved Hide resolved
mreg_cli/cli.py Outdated Show resolved Hide resolved
mreg_cli/recordhttp.py Outdated Show resolved Hide resolved
mreg_cli/recordhttp.py Outdated Show resolved Hide resolved
mreg_cli/main.py Outdated Show resolved Hide resolved
mreg_cli/log.py Outdated Show resolved Hide resolved
mreg_cli/recordhttp.py Outdated Show resolved Hide resolved
@terjekv terjekv self-requested a review May 24, 2023 14:19
Copy link
Collaborator

@terjekv terjekv left a comment

Choose a reason for hiding this comment

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

Looks good to me!

- Rename the file recordhttp.py to recorder.py
- Change all instances of recordhttp to recorder and change the variable names to rec
- Add a comment to docker-compose.yml that explains the purpose of the dummy container
- Add types to the functions in recorder.py
- Add comments about why compare to empty string
@oyvindhagberg oyvindhagberg force-pushed the test-with-real-server-2023-05 branch from aedb112 to 357f7ba Compare May 26, 2023 09:24
@oyvindhagberg oyvindhagberg marked this pull request as ready for review May 26, 2023 09:24
@oyvindhagberg oyvindhagberg merged commit 357f7ba into master May 26, 2023
@oyvindhagberg oyvindhagberg deleted the test-with-real-server-2023-05 branch May 26, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants