Skip to content

Conversation

Ilyesbdlala
Copy link
Member

@Ilyesbdlala Ilyesbdlala commented May 12, 2023

Description

closes #150
Current status: Cronjob configuration works (tested manually), However no unit test have been implemented. Unit tests are implemented that use polling to test if the cronjob has started. This is slower by a maximum of 60 seconds and a minimum of 0 seconds. the slow test has the golang build tag "slow" and other/fast tests have the tag "fast".
Calling make test runs all tests i.e "slow and fast"
Calling make test-fast runs only the tests with "fast" tag.

Checklist

  • Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests.
  • Make sure that all your commits are signed-off and that you are added to the Contributors file.
  • Make sure that all CI finish successfully.
  • Optional (but appreciated): Make sure that all commits are Verified.

@Ilyesbdlala Ilyesbdlala added the enhancement New feature or request label May 12, 2023
@Ilyesbdlala Ilyesbdlala self-assigned this May 12, 2023
@github-actions
Copy link

github-actions bot commented May 12, 2023

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
⚠️ GO golangci-lint 9 1 2.47s
✅ JSON eslint-plugin-jsonc 2 0 1.19s
⚠️ YAML prettier 1 1 1.64s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@Ilyesbdlala Ilyesbdlala force-pushed the feature/scheduledscan-cronjob branch from 062d04d to 241c10b Compare June 6, 2023 13:07
@Ilyesbdlala
Copy link
Member Author

Ilyesbdlala commented Jun 6, 2023

Current status: Cronjob configuration works (tested manually), However no unit test have been implemented. Unit tests are implemented that use polling to test if the cronjob has started. This is slower by a maximum of 60 seconds and a minimum of 0 seconds. the slow test has the golang build tag "slow" and other/fast tests have the tag "fast".
Calling make test runs all tests i.e "slow and fast"
Calling make test-fast runs only the tests with "fast" tag.

@Ilyesbdlala Ilyesbdlala force-pushed the feature/scheduledscan-cronjob branch from 241c10b to 5ebb84a Compare June 13, 2023 09:29
@Ilyesbdlala Ilyesbdlala marked this pull request as ready for review June 13, 2023 09:30
@Ilyesbdlala Ilyesbdlala changed the title WIP: Added a crontab configuration option to scheduledScans Added a crontab configuration option to scheduledScans Jun 13, 2023
@Ilyesbdlala Ilyesbdlala force-pushed the feature/scheduledscan-cronjob branch from 038ebaa to e750f61 Compare June 16, 2023 10:06
@rseedorff rseedorff added this to the v4.1.0 milestone Jun 28, 2023
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
fakeClock can fake the passing of time

Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
…ion is found

and included the changes to FakeClock. It will be however later changed depending on the solution

Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
… Cron Schedule tests

This minimizes how much the test is slowed down (slower by between 0 and 50 seconds)

Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
This is done to make sure that any edge cases do not fail the tests
we still expect to be a maximum 60s

Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
fast tests can be called by "make test-fast" and all tests will run when command "make test" is used.
This is done to keep the CI workflow as usual

Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
…of scheduledScan

Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
@Ilyesbdlala Ilyesbdlala force-pushed the feature/scheduledscan-cronjob branch from dc44598 to 21fc70b Compare July 14, 2023 13:36
@J12934 J12934 merged commit f3ab737 into main Jul 14, 2023
@J12934 J12934 deleted the feature/scheduledscan-cronjob branch July 14, 2023 17:23
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
Archived in project
Development

Successfully merging this pull request may close these issues.

➹ Add a crontab configuration option to scheduledScans
3 participants