Convert tests to actions-operator and pytest-operator (#18)
* Convert tests to actions-operator and pytest-operator
Clean up the integration test workflow by leveraging actions-operator
for the environment setup and pytest-operator for model helpers and
doing the testing in Python.
* Refactor RBAC management in tests to Workflow
Managing the RBAC feature within the test ran into issues due to the API
server restarting which interrupted the model connection to the
controller. Additionally, it made the tests coupled to microk8s rather
than being able to run against any K8s cluster.
* Fix workflow syntax error
* Fix perm error on snap alias
* Fix env syntax and sg command for disabling RBAC in workflow
* Fix sg syntax in workflow and custom arg passing through tox
* Fix parallel charmcraft builds
Charmcraft checks for and, if not present, adds a LXC remote for it's
build environment image. If multiple builds are started in parallel,
there's a race condition where they both see that the remote isn't
present and then both try to add it, leading to one of them failing.
* More charmcraft pre-init in workflow
* Do builds sequentially to try to get past build issues
* Remove git dependency in requirements
The oci-image library was released to PyPI some time ago, so use that
instead of the git repo.
* Refactor RBAC check to not use wait_for_idle
The behavior of `wait_for_idle` returning immediately as soon as *any*
unit is in error, even with `raise_on_error=False` was causing some
strangeness with the test attempting to resolve a unit before it was in
error (somehow).
* Add some debug logging
* Increase workflow timeout
* Restore default wait_period to try to figure out why it was failing
* Some debugging for inconsistent test behavior
Add MetalLB logo as icon (#16)
* first commit
* bundle draft
* functional bundle for local charms
* add charms in single bundle
* make config-changed update the ip range
* add remove hook for controller api events
* fix error, each charm deployed once
* add Makefile build action for bundle
* not keeping built versions in git
* commit changes before removing file
* not keeping built versions in git
* not tracking builds
* Add remove event for speaker
* add example app
* update README for charms and bundle
* Info for developers
* lint
* ignore .tox file
* remove .tox from git tracking
* Add unit tests for metallb controller
* keep tox only, get rid of Makefile
* switch to command line options instead of file
* fix order of patch objects
* add unit tests for metallb-speaker
* remove unused files
* stop using duplicated .build directory instead of build
* replace makefile by tox actions
* unecessary lines
* tox replaced makefile
* change bundle for operator
* add info for devs
* Add github action for linting with flake8
* add basic github action directory and check formating with tox
* testing basic workflow
* testing basic workflow
* add github action for linting
* list of paths to test
* try flake8 option
* remove pylint
* fix extra flake8 options
* Add functional test with gitlab actions
* add func test
* syntax
* syntax
* syntax
* add sufficient permissions
* add runner to microk8s group to avoid sudo usage
* run lint only on PR. tox -e lint should be runned locally for development
* syntax
* test with sudo
* add charm build and deploy
* syntax
* syntax
* add flag for charmcraft channel
* trying to find the charms directory
* checkout code needed for charm building
* specify local charms ./
* syntax
* fix order of steps
* add iprange, juju wait
* add dependency for juju wait
* add juju status to artifacts
* trying to figure out why juju wait isn't found in subsequent step
* try the snap instead
* setup artifacts
* fix artifacts conditional
* fix artifacts conditional
* test curl and failure
* add gate check for juju status on error or blocked
* add gate check for juju status on error or blocked
* temporary check to find external ip range
* fix ip range. runner is on 10.1.0.4/16, so range must be somewhere in there. And we only need one ip to test.
* missing echo
* temp test curl failure
* temp test curl failure
* add connection timeout in case of failure
* avoid long lines
* combine all jobs in a workflow, make func test run only if lint successfull
* turn all but flake8 to false
* set to run only on PR
* change name
* Enable multiple ip pools
* enable multiple ip pools
* shorten name
* update bug link
* Changes for code-review
* changes from code review https://github.com/charmed-kubernetes/metallb-operator/pull/1
* get all tests into one workflow
* remove unused sections of tox
* fix modified function name for bind_role
* add unit test in github actions
* test with github action tox-gh-actions
* full exec path for tox
* setup python to be able to use tox, following https://docs.github.com/en/actions/guides/building-and-testing-python#running-tests-with-tox
* syntax
* add unit tests for metallb-speaker and test failure
* re-add path
* restore original pythonpath setting
* remove extra stuff from tox.ini
* Use an oci-image resource for container images
* changes from code review https://github.com/charmed-kubernetes/metallb-operator/pull/1
* get all tests into one workflow
* remove unused sections of tox
* fix modified function name for bind_role
* add unit test in github actions
* test with github action tox-gh-actions
* full exec path for tox
* setup python to be able to use tox, following https://docs.github.com/en/actions/guides/building-and-testing-python#running-tests-with-tox
* syntax
* add unit tests for metallb-speaker and test failure
* re-add path
* restore original pythonpath setting
* remove extra stuff from tox.ini
* use oci_image
* set requirement as zip, otherwise it fails to download in the github actions
* add resources to github action deploy
* at cli, resource is singular
* test if pull_request_target will run on forked repo
* Replace storage step by new storage option in microk8s action
* Add compatibility for RBAC
* latest microk8s action includes the storage addon option
* ensure that the charm is blocked if api fails
* add rbac permissions file for if RBAC enable
* move error handling in original function in utils
* apply rbac changes
* optimize rbac yaml
* pep8
* add func test with rbac
* edit workflow name, conflict
* missing 'run'
* update workflow latest microk8s action
* using _target prevents us from being able to edit the workflow
* missing sudo
* mock oci_image and config_change only executes after started
* mock oci_image
* pep8
* update README with RBAC info
* units resolve automatically
* sometimes, juju bootstrap runs too quickly for workflow to succeed
* update namespace to fit workflow namespace
* fix error, role was not applied to serviceaccount
* forgot to re-add _ to stored attribute after test
* units may resolve automatically, but we should check if it needs a resolve action
* condense jobs in one workflow
* fix indent, add sleep
* add sleep
* tests are short, no need to add dependency for now
* still catching occasional failures at 10s
* add upstream-source as reference for users
* rename file because it is actually changing the operators permissions, not the controller permissions
* add log failure in the workflow
* add log failure in the workflow
* update namespace
* the units should resolve on their own, but if the check is done too quickly, then juju see units idle before they start resolving. adding a sleep here should help before the juju-wait check
* duplicate
* use yq to fetch upstream image info from metadata.yaml
* add MetalLB icon
* add MetalLB icon
* synching with master
* use same icon for each charm and for the bundle