fix-integration-tests #403

Merged
p4u1 merged 22 commits from p4u1/abra:fix-integration-tests into main 2024-03-11 13:27:21 +00:00
Member

In preparation for the new abra release, let's fix all integration tests

After merging, this needs to be cherry-picked into the release-0-9 branch.

  • app_backup.bats (skip this one)
  • app_check.bats (fixed by bd21014fed)
  • app_cmd.bats (partially fixed in 08232b74f6), has known regression coop-cloud/organising#581
  • app_config.bats (no changes needed)
  • app_cp.bats (no changes needed)
  • app_deploy.bats
  • app_errors.bats (no changes needed)
  • app_list.bats (no changes needed)
  • app_logs.bats (no changes needed)
  • app_new.bats (no changes needed)
  • app_ps.bats (no changes needed)
  • app_remove.bats (fixed by 2f29fbeb2e)
  • app_restart.bats (no changes needed
  • app_restore.bats (fixed by f2dd5afc38)
  • app_rollback.bats (partially fixed by 6e99b74c24)
  • app_run.bats (no changes needed)
  • app_secret.bats (fixed by bd069d32f6)
  • app_services.bats (no changes needed)
  • app_undeploy.bats (no changes needed)
  • app_upgrade.bats (no changes needed)
  • app_version.bats (partially fixed by ad323ad2bd)
  • app_volume.bats (fixed by 03c3823770)
  • autocomplete.bats (no changes needed)
  • catalogue.bats (no changes needed)
  • dirs.bats (no changes needed)
  • install.bats (failes, but is expected)
  • recipe_diff.bats (no changes needed)
  • recipe_fetch.bats (no changes needed)
  • recipe_lint.bats (fixed by b6b0808066)
  • recipe_list.bats (no changes needed)
  • recipe_new.bats (fixed by 0aac464ded)
  • recipe_release.bats (no changes needed)
  • recipe_reset.bats (no changes needed)
  • recipe_sync.bats (no changes needed)
  • recipe_upgrade.bats (fixed by ab86904cf4)
  • recipe_version.bats (fixed by 81897bf4da)
  • server_add.bats
  • server_list.bats
  • server_prune.bats (no changes needed)
  • server_remove.bats
  • upgrade.bats
  • version.bats (no changes needed)
In preparation for the new abra release, let's fix all integration tests After merging, this needs to be cherry-picked into the release-0-9 branch. - [x] app_backup.bats (skip this one) - [x] app_check.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd21014fedf6f8d4fb8f1baf44fb8b0df99fc326) - [x] app_cmd.bats (partially fixed in https://git.coopcloud.tech/coop-cloud/abra/commit/08232b74f6d512ab2ca7c08f67bb7c227b82a2ca), has known regression https://git.coopcloud.tech/coop-cloud/organising/issues/581 - [x] app_config.bats (no changes needed) - [x] app_cp.bats (no changes needed) - [x] app_deploy.bats - [x] app_errors.bats (no changes needed) - [x] app_list.bats (no changes needed) - [x] app_logs.bats (no changes needed) - [x] app_new.bats (no changes needed) - [x] app_ps.bats (no changes needed) - [x] app_remove.bats (fixed by [2f29fbeb2e](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/2f29fbeb2e018656413fa25f8615b7a98cdcb083)) - [x] app_restart.bats (no changes needed - [x] app_restore.bats (fixed by [f2dd5afc38](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/f2dd5afc38a25a8316899fa0c6d59499445868d7)) - [x] app_rollback.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/6e99b74c24e92a293a5f71d7aacd552441dc8613) - [x] app_run.bats (no changes needed) - [x] app_secret.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/bd069d32f6d58f12cf8b0d2a1fef0e4cdc50d94d) - [x] app_services.bats (no changes needed) - [x] app_undeploy.bats (no changes needed) - [x] app_upgrade.bats (no changes needed) - [x] app_version.bats (partially fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/ad323ad2bd6184c69baf909f891a8bf8ffc168a4) - [x] app_volume.bats (fixed by [03c3823770](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/03c38237707ae795b723180eb07a7edc84a8de35)) - [x] autocomplete.bats (no changes needed) - [x] catalogue.bats (no changes needed) - [x] dirs.bats (no changes needed) - [x] install.bats (failes, but is expected) - [x] recipe_diff.bats (no changes needed) - [x] recipe_fetch.bats (no changes needed) - [x] recipe_lint.bats (fixed by [b6b0808066](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/b6b0808066a11e4bcd77517ec39600d500bcb944)) - [x] recipe_list.bats (no changes needed) - [x] recipe_new.bats (fixed by [0aac464ded](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/0aac464ded6b43afb3ec37ade2f64d6191b9838f)) - [x] recipe_release.bats (no changes needed) - [x] recipe_reset.bats (no changes needed) - [x] recipe_sync.bats (no changes needed) - [x] recipe_upgrade.bats (fixed by [ab86904cf4](https://git.coopcloud.tech/coop-cloud/abra/pulls/403/commits/ab86904cf45db89c7c189ca1fd9971909bd446dd)) - [x] recipe_version.bats (fixed by https://git.coopcloud.tech/coop-cloud/abra/commit/81897bf4daf6d37f3997fdea0deafb1d8f241c6c) - [x] server_add.bats - [x] server_list.bats - [x] server_prune.bats (no changes needed) - [x] server_remove.bats - [x] upgrade.bats - [x] version.bats (no changes needed)
p4u1 added 1 commit 2024-02-15 16:33:04 +00:00
continuous-integration/drone/pr Build is passing Details
bd21014fed
fix tests/integration/app_check.bats
p4u1 added 1 commit 2024-02-15 17:10:13 +00:00
continuous-integration/drone/pr Build is passing Details
6e99b74c24
partially fix tests/integration/app_rollback.bats
p4u1 added 1 commit 2024-02-18 11:04:28 +00:00
continuous-integration/drone/pr Build is passing Details
bd069d32f6
fix tests/integration/app_secret.bats
p4u1 added 2 commits 2024-02-18 11:22:39 +00:00
p4u1 added 1 commit 2024-02-18 13:12:36 +00:00
continuous-integration/drone/pr Build is passing Details
03c3823770
fix tests/integration/app_volume.bats
p4u1 added 1 commit 2024-02-18 13:26:49 +00:00
continuous-integration/drone/pr Build is passing Details
f2dd5afc38
fix tests/integration/app_restore.bats
p4u1 added 1 commit 2024-02-18 19:41:02 +00:00
continuous-integration/drone/pr Build is passing Details
08232b74f6
partially fix tests/integration/app_cmd.bats
p4u1 added 1 commit 2024-02-18 20:57:41 +00:00
continuous-integration/drone/pr Build is passing Details
8a84b1067c
partially fix tests/integration/recipe_version.bats
p4u1 added 1 commit 2024-02-23 11:12:59 +00:00
continuous-integration/drone/pr Build is passing Details
2f29fbeb2e
fix tests/integration/app_remove.bats
p4u1 added 1 commit 2024-02-23 11:21:10 +00:00
continuous-integration/drone/pr Build is passing Details
b6b0808066
fix tests/integration/recipe_lint.bats
p4u1 added 1 commit 2024-02-23 11:35:05 +00:00
continuous-integration/drone/pr Build is passing Details
0aac464ded
fix tests/integration/recipe_new.bats
p4u1 added 1 commit 2024-02-23 11:37:29 +00:00
continuous-integration/drone/pr Build is passing Details
ab86904cf4
fix tests/integration/recipe_upgrade.bats
decentral1se reviewed 2024-03-03 14:07:05 +00:00
decentral1se left a comment
Owner

Thanks for this work! A few comments...

Also, several instances of shuffling the argument handling order which I think is related to #404? Ideally, this shouldn't be necessary and we can pin and maintain the current behaviour. Possible changes to this can come in a new proposal.

Thanks for this work! A few comments... Also, several instances of shuffling the argument handling order which I think is related to https://git.coopcloud.tech/coop-cloud/abra/pulls/404? Ideally, this shouldn't be necessary and we can pin and maintain the current behaviour. Possible changes to this can come in a new proposal.
pkg/git/init.go Outdated
@ -9,3 +9,2 @@
// Init inits a new repo and commits all the stuff if you want
func Init(repoPath string, commit bool) error {
if _, err := gitPkg.PlainInit(repoPath, false); err != nil {
func Init(repoPath string, commit bool, gitUser, gitEmail string) error {
Owner

This seems like a behaviour change, not a fix? What error were you facing?

I wouldn't mind erroring out here in the case people don't have a ~/.gitconfig instead of implementing this as additional flags? According to https://pkg.go.dev/github.com/go-git/go-git/v5#CommitOptions 👉 "If Author is empty the Name and Email is read from the config".

We could also additionally document to support people to know how to do this inside of Git and not in Abra?

This seems like a behaviour change, not a fix? What error were you facing? I wouldn't mind erroring out here in the case people don't have a `~/.gitconfig` instead of implementing this as additional flags? According to https://pkg.go.dev/github.com/go-git/go-git/v5#CommitOptions 👉 "If Author is empty the Name and Email is read from the config". We could also additionally document to support people to know how to do this inside of Git and not in Abra?
Author
Member

Yeah this is a behavior change. It is for the case when no author is set in the ~/.gitconfig. I think it is a nice addition but probably better to pull it out into a separate pull request

Yeah this is a behavior change. It is for the case when no author is set in the `~/.gitconfig`. I think it is a nice addition but probably better to pull it out into a separate pull request
Owner

@p4u1 yeh I'd say raise an issue and pull it out for now. We can loop back in another change.

@p4u1 yeh I'd say raise an issue and pull it out for now. We can loop back in another change.
Author
Member

Pulled it out into a seperate pull request #405
Also opened a issue coop-cloud/organising#580

Pulled it out into a seperate pull request https://git.coopcloud.tech/coop-cloud/abra/pulls/405 Also opened a issue https://git.coopcloud.tech/coop-cloud/organising/issues/580
p4u1 marked this conversation as resolved
@ -71,3 +71,3 @@
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
assert_output --partial 'behind 3'
assert_output --partial "Your branch is behind 'origin/main' by 3 commits"
Owner

Seems a bit brittle, could we instead do a assert_output --regexp 'behind .* 3 commits'? Because that is the main thing we're matching on. Not the branch name / remote and so on. I think this might save us revisiting mass-edits on this again in the near future.

Same applies for the rest of the edits like this elsewhere.

Seems a bit brittle, could we instead do a `assert_output --regexp 'behind .* 3 commits'`? Because that is the main thing we're matching on. Not the branch name / remote and so on. I think this might save us revisiting mass-edits on this again in the near future. Same applies for the rest of the edits like this elsewhere.
Author
Member

Sound good, changed it

Sound good, changed it
decentral1se marked this conversation as resolved
@ -104,3 +104,3 @@
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
refute_output --partial 'behind 3'
assert_output --partial "Your branch is up to date with 'origin/main'"
Owner

assert_output --partial "up to date"?

`assert_output --partial "up to date"`?
Author
Member

Sound good, changed it

Sound good, changed it
decentral1se marked this conversation as resolved
@ -108,0 +107,4 @@
# TODO: should wait as long as volume is no longer in use
sleep 10
run $ABRA app volume rm "$TEST_APP_DOMAIN" --no-input
Owner

Isn't this covered by #399 now?

Isn't this covered by https://git.coopcloud.tech/coop-cloud/abra/pulls/399 now?
Author
Member

It should be, but doesn't seem to work for me without the sleep. Can you check if it works for you without the sleep?

It should be, but doesn't seem to work for me without the sleep. Can you check if it works for you without the sleep?
Owner
https://git.coopcloud.tech/coop-cloud/organising/issues/582
decentral1se marked this conversation as resolved
decentral1se reviewed 2024-03-03 14:33:52 +00:00
@ -13,3 +13,3 @@
@test "error if not present in catalogue" {
run $ABRA recipe versions "$TEST_RECIPE"
run $ABRA recipe versions "not-in-catalogue"
Owner

Ah, this should be reverted because the example should never be in the catalogue but it can be cloned by abra. So the resulting error is now "can't clone", not "can't find in catalogue". I just realised I can't push to your fork so here is the diff:

diff --git a/tests/integration/recipe_version.bats b/tests/integration/recipe_version.bats
index d25faef..eea0bce 100644
--- a/tests/integration/recipe_version.bats
+++ b/tests/integration/recipe_version.bats
@@ -12,7 +12,7 @@ setup() {
 }

 @test "error if not present in catalogue" {
-  run $ABRA recipe versions "not-in-catalogue"
+  run $ABRA recipe versions "example"
   assert_failure
   assert_output --partial "is not published on the catalogue"
 }
Ah, this should be reverted because the `example` should never be in the catalogue *but* it can be cloned by `abra`. So the resulting error is now "can't clone", not "can't find in catalogue". I just realised I can't push to your fork so here is the diff: ```diff diff --git a/tests/integration/recipe_version.bats b/tests/integration/recipe_version.bats index d25faef..eea0bce 100644 --- a/tests/integration/recipe_version.bats +++ b/tests/integration/recipe_version.bats @@ -12,7 +12,7 @@ setup() { } @test "error if not present in catalogue" { - run $ABRA recipe versions "not-in-catalogue" + run $ABRA recipe versions "example" assert_failure assert_output --partial "is not published on the catalogue" } ```
p4u1 marked this conversation as resolved
p4u1 added 1 commit 2024-03-04 15:24:59 +00:00
continuous-integration/drone/pr Build is passing Details
1fd14fa76f
patches by decentral1se
Co-authored-by: decentral1se <cellarspoon@riseup.net>
Author
Member

We are getting closer! Thanks for you feedback to my changes, I will take a closer look soon.

Also you should have edit rights now :)

We are getting closer! Thanks for you feedback to my changes, I will take a closer look soon. Also you should have edit rights now :)
p4u1 added 1 commit 2024-03-04 15:31:16 +00:00
continuous-integration/drone/pr Build is passing Details
a760280564
changes git message asserts
p4u1 added 1 commit 2024-03-07 16:49:05 +00:00
continuous-integration/drone/pr Build is passing Details
a44549117d
Revert "fix tests/integration/recipe_new.bats"
This reverts commit 0aac464ded.
p4u1 added 1 commit 2024-03-11 11:28:54 +00:00
continuous-integration/drone/pr Build is passing Details
e84297425e
partial fix app_deploy.bats
decentral1se added 1 commit 2024-03-11 13:03:42 +00:00
continuous-integration/drone/pr Build is passing Details
81897bf4da
test: skip known failures [ci skip]
See #403
p4u1 added 1 commit 2024-03-11 13:04:05 +00:00
p4u1 added 1 commit 2024-03-11 13:11:44 +00:00
continuous-integration/drone/pr Build is passing Details
0ca65b1d4f
skip expected failure when running tests locally
p4u1 added 1 commit 2024-03-11 13:21:35 +00:00
continuous-integration/drone/pr Build is passing Details
0344203209
properly reset recipe
decentral1se added 1 commit 2024-03-11 13:22:35 +00:00
continuous-integration/drone/pr Build is passing Details
ef5f54e146
test: skip this test for $reasons
See #403
p4u1 merged commit 40c0fb4bac into main 2024-03-11 13:27:21 +00:00
p4u1 deleted branch fix-integration-tests 2024-03-11 13:27:21 +00:00
p4u1 referenced this issue from a commit 2024-03-11 13:27:21 +00:00
p4u1 referenced this issue from a commit 2024-03-11 13:29:01 +00:00
Sign in to join this conversation.
No description provided.