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

fix: Fix unit tests #371

Merged
merged 6 commits into from Jun 6, 2023
Merged

fix: Fix unit tests #371

merged 6 commits into from Jun 6, 2023

Conversation

fnesveda
Copy link
Member

@fnesveda fnesveda commented Jun 2, 2023

The CLI unit tests were not running correctly for a while.

The problem was:

  • some tests were configured to be skipped when the ~/.apify directory exists (meaing somebody is already logged in with apify login)
  • but before each command, the checkLatestVersion method was called, which writes the latest version to ~/.apify/state.json
  • this caused all of the tests which checked for ~/.apify existence to be skipped

I fixed it so that:

  • the checkLatestVersion is skipped when the APIFY_CLI_SKIP_UPDATE_CHECK environment variable is set
  • the tests are called with APIFY_CLI_SKIP_UPDATE_CHECK=1
  • the tests actually fail if the ~/.apify directory exists at their start (so that we notice these issues immediately next time)
  • the after() hook is skipped if the before() hook throws an error (this was causing some chdirs to be called when they shouldn't be)

Fixing the test execution revealed some errors in the push test, so I fixed those too - I mostly deleted some tests which didn't really make sense.

I also fixed the tests to clean up the created actors on the platform.

Closes #369.

@fnesveda fnesveda added bug Something isn't working. adhoc Ad-hoc unplanned task added during the sprint. t-platform Issues with this label are in the ownership of the platform team. labels Jun 2, 2023
@fnesveda fnesveda added this to the 64th sprint - Platform team milestone Jun 2, 2023
@fnesveda fnesveda self-assigned this Jun 2, 2023
@fnesveda fnesveda merged commit 6ad5684 into master Jun 6, 2023
18 checks passed
@fnesveda fnesveda deleted the fix/fix-tests branch June 6, 2023 10:54
@fnesveda fnesveda added the validated Issues that are resolved and their solutions fulfill the acceptance criteria. label Oct 9, 2023
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adhoc Ad-hoc unplanned task added during the sprint. bug Something isn't working. t-platform Issues with this label are in the ownership of the platform team. tested Temporary label used only programatically for some analytics. validated Issues that are resolved and their solutions fulfill the acceptance criteria.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests are broken in CI
2 participants