Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samoht committed Feb 3, 2025
1 parent af21acc commit 344edb6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 38 deletions.
20 changes: 2 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,30 +113,14 @@ dune-release help distrib

### Publish the distribution and documentation online

Once the distribution archive is created you can now publish it and its documentation online.

You can publish the archive only with:
Once the distribution archive is created you can now publish it with:

```
dune-release publish distrib
dune-release publish
```

This means creating a Github release associated with the tag and upload the distribution tarball as a release artifact.

You can publish the documentation only with:

```
dune-release publish doc
```

This means publishing the dune generated documentation to `gh-pages` to be served as a static website on github.io.

If neither `distrib` neither `doc` is specified, `dune-release` publishes both:

```
dune-release publish
```

The full documentation of this command is available with
```
dune-release help publish
Expand Down
4 changes: 2 additions & 2 deletions tests/bin/invalid-version-number/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ We do the whole dune-release process
[+] Distribution for whatever 3.3.4~4.10preview1
[+] Archive _build/whatever-3.3.4~4.10preview1.tbz

(2) publish distrib
(2) publish

$ dune-release publish distrib --dry-run --yes | grep preview1
$ dune-release publish --dry-run --yes | grep preview1
=> must exists _build/whatever-3.3.4~4.10preview1.tbz
-: exec: git --git-dir .git rev-parse --verify refs/tags/3.3.4_4.10preview1
-: exec: git --git-dir .git rev-parse --verify refs/tags/3.3.4_4.10preview1
Expand Down
11 changes: 2 additions & 9 deletions tests/bin/no-doc/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ We need to set up a git project for dune-release to work properly
$ git commit -m "Initial commit" > /dev/null
$ dune-release tag -y > /dev/null

Trying to publish the documentation explicitly should fail:
Trying to publish should be ok:

$ dune-release publish doc -y --dry-run > /dev/null
dune-release: [ERROR] directory contents _build/whatever-0.1.0: No such file or directory
[3]

By default it should skip the documentation generation:

$ dune-release publish -y --dry-run | grep Skipping
[-] Skipping documentation publication for package whatever: no doc field in whatever.opam
$ dune-release publish -y --dry-run > /dev/null
6 changes: 0 additions & 6 deletions tests/bin/non-github-doc-uri/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,3 @@ a github URI to publish the documentation to.
dune-release: [ERROR] Github development repository URL could not be inferred
[FAIL] opam field doc cannot be parsed by dune-release
[FAIL] lint of _build/whatever-0.1.0 and package whatever failure: 1 errors.

(2) publish doc

$ dune-release publish doc --dry-run > /dev/null
dune-release: [ERROR] Could not derive publication directory $PATH from opam doc field value "https://whatever.io/doc/main.html"; expected the pattern $SCHEME://$USER.github.io/$REPO/$PATH
[3]
4 changes: 2 additions & 2 deletions tests/bin/non-github-uri/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ archive should fail as only publishing to github is supported.
dune-release: [ERROR] Github development repository URL could not be inferred
[FAIL] lint of _build/whatever-0.1.0 and package whatever failure: 1 errors.

(2) publish distrib
(2) publish

$ dune-release publish distrib --dry-run > /dev/null
$ dune-release publish --dry-run > /dev/null
dune-release: [ERROR] Github development repository URL could not be inferred from opam files.
[3]
2 changes: 1 addition & 1 deletion tests/bin/opam-pkg-distrib-uri-opt/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ We also need a dummy distrib file to keep the test simple:
$ mkdir _build
$ touch _build/whatever-0.1.0.tbz

And a url file as if we just successfully ran dune-release publish distrib:
And a url file as if we just successfully ran dune-release publish:

$ echo "https://some.fake.url/mytarball.tbz" > _build/whatever-0.1.0.url

Expand Down

0 comments on commit 344edb6

Please sign in to comment.