Skip to content

Commit

Permalink
add tests for forges not supporting organization style repo
Browse files Browse the repository at this point in the history
Signed-off-by: teague hansen <thanse23@asu.edu>
  • Loading branch information
H-ANSEN committed Jul 25, 2024
1 parent 17f4de0 commit f35d173
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions test/blackbox-tests/test-cases/source-stanza.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Test a generated 'github' user repo

Test a generated 'gitlab' user repo

$ sed -i '4c\(source (gitlab user/repo))' dune-project
$ sed -i '4s|.*|(source (gitlab user/repo))|' dune-project
$ dune build
$ cat foo.opam | grep -i gitlab
homepage: "https://gitlab.com/user/repo"
Expand All @@ -30,16 +30,16 @@ Test a generated 'gitlab' user repo

Test a generated 'sourcehut' user repo

$ sed -i '4c\(source (sourcehut user/repo))' dune-project
$ sed -i '4s|.*|(source (sourcehut user/repo))|' dune-project
$ dune build
$ cat foo.opam | grep -i sr.ht
homepage: "https://sr.ht/~user/repo"
bug-reports: "https://todo.sr.ht/~user/repo"
dev-repo: "git+https://git.sr.ht/~user/repo"

Test a generated 'bitbucket' ruser repo
Test a generated 'bitbucket' user repo

$ sed -i '4c\(source (bitbucket user/repo))' dune-project
$ sed -i '4s|.*|(source (bitbucket user/repo))|' dune-project
$ dune build
$ cat foo.opam | grep -i bitbucket
homepage: "https://bitbucket.org/user/repo"
Expand All @@ -48,9 +48,46 @@ Test a generated 'bitbucket' ruser repo

Test a generated 'gitlab' organization repo

$ sed -i '4c\(source (gitlab organization/project/repo))' dune-project
$ sed -i '4s|.*|(source (gitlab organization/project/repo))|' dune-project
$ dune build
$ cat foo.opam | grep -i gitlab
homepage: "https://gitlab.com/organization/project/repo"
bug-reports: "https://gitlab.com/organization/project/repo/-/issues"
dev-repo: "git+https://gitlab.com/organization/project/repo.git"

Test that the creation of a source stanza of the form 'org/project/repo' is
disallowed by any forge type other than gitlab and that associated error
messages are provided

Test github forge.

$ sed -i '4s|.*|(source (github org/proj/repo))|' dune-project
$ dune build
File "dune-project", line 4, characters 16-29:
4 | (source (github org/proj/repo))
^^^^^^^^^^^^^
Error: Github repository must be of form user/repo
Hint: The provided form 'org/proj/repo' is specific to Gitlab projects
[1]

Test bitbucket forge.

$ sed -i '4s|.*|(source (bitbucket org/proj/repo))|' dune-project
$ dune build
File "dune-project", line 4, characters 19-32:
4 | (source (bitbucket org/proj/repo))
^^^^^^^^^^^^^
Error: Bitbucket repository must be of form user/repo
Hint: The provided form 'org/proj/repo' is specific to Gitlab projects
[1]

Test sourcehut forge.

$ sed -i '4s|.*|(source (sourcehut org/proj/repo))|' dune-project
$ dune build
File "dune-project", line 4, characters 19-32:
4 | (source (sourcehut org/proj/repo))
^^^^^^^^^^^^^
Error: Sourcehut repository must be of form user/repo
Hint: The provided form 'org/proj/repo' is specific to Gitlab projects
[1]

0 comments on commit f35d173

Please sign in to comment.