1
mirror of https://github.com/rclone/rclone synced 2024-11-05 01:42:31 +01:00
rclone/docs
Ole Frost 5e91b93e59 cmdtest: end-to-end test for commands, flags and environment variables
There was no easy way to automatically test the end-to-end functionality
of commands, flags, environment variables etc.

The need for end-to-end testing was highlighted by the issues fixed
in #5341. There was no automated test to continually verify current
behaviour, nor a framework to quickly test the correctness of the fixes.

This change adds an end-to-end testing framework in the cmdtest folder.
It has some simple examples in func TestCmdTest in cmdtest_test.go. The
tests should be readable by anybody familiar with rclone and look like
this:

    // Test the rclone version command with debug logging (-vv)
    out, err = rclone("version", "-vv")
    if assert.NoError(t, err) {
        assert.Contains(t, out, "rclone v")
        assert.Contains(t, out, "os/version:")
        assert.Contains(t, out, " DEBUG : ")
    }

The end-to-end tests are executed just like the Go unit tests, that is:

    go test ./cmdtest -v

The change also contains a thorough test of environment variables in
environment_test.go.

Thanks to @ncw for encouragement and introduction to the TestMain trick.
2021-07-05 16:38:20 +01:00
..
content cmdtest: end-to-end test for commands, flags and environment variables 2021-07-05 16:38:20 +01:00
i18n website: Adapt to hugo v0.27.1 2017-09-30 09:19:53 +01:00
layouts Add google search widget to rclone.org 2021-07-05 16:21:36 +01:00
static Add google search widget to rclone.org 2021-07-05 16:21:36 +01:00
config.json docs: Add link to source and modified time to footer of every page 2020-06-01 13:07:46 +01:00
README.md docs: update rclone about docs 2020-11-27 14:08:52 +00:00

Docs

This directory tree is used to build all the different docs for rclone.

See the content directory for the docs in markdown format.

Note that some of the docs are auto generated - these should have a DO NOT EDIT marker near the top.

Use hugo to build the website.

Changing the layout

If you want to change the layout then the main files to edit are

  • layout/index.html for the front page
  • chrome/*.html for the HTML fragments
  • _default/single.md for the default template
  • page/single.md for the page template

Running make serve in a terminal give a live preview of the website so it is easy to tweak stuff.

What are all these files

├── config.json                   - hugo config file
├── content                       - docs and backend docs
│   ├── _index.md                 - the front page of rclone.org
│   ├── commands                  - auto generated command docs - DO NOT EDIT
├── i18n
│   └── en.toml                   - hugo multilingual config
├── layouts                       - how the markdown gets converted into HTML
│   ├── 404.html                  - 404 page
│   ├── chrome                    - contains parts of the HTML page included elsewhere
│   │   ├── footer.copyright.html - copyright footer
│   │   ├── footer.html           - footer including scripts
│   │   ├── header.html           - the whole html header
│   │   ├── header.includes.html  - header includes e.g. css files
│   │   ├── menu.html             - left hand side menu
│   │   ├── meta.html             - meta tags for the header
│   │   └── navbar.html           - top navigation bar
│   ├── _default
│   │   └── single.html           - the default HTML page render
│   ├── index.html                - the index page of the whole site
│   ├── page
│   │   └── single.html           - the render of all "page" type markdown
│   ├── partials                  - bits of HTML to include into layout .html files
│   │   └── version.html          - the current version number
│   ├── rss.xml                   - template for the RSS output
│   ├── section                   - rendering for sections
│   │   └── commands.html         - rendering for /commands/index.html
│   ├── shortcodes                - shortcodes to call from markdown files
│   │   ├── cdownload.html        - download the "current" version
│   │   ├── download.html         - download a version with the partials/version.html number
│   │   ├── provider.html         - used to make provider list on the front page
│   │   └── version.html          - used to insert the current version number
│   └── sitemap.xml               - sitemap template
├── public                        - render of the website
├── README.md                     - this file
├── resources                     - don't know!
│   └── _gen
│       ├── assets
│       └── images
└── static                        - static content for the website
    ├── css
    │   ├── bootstrap.css
    │   ├── custom.css            - custom css goes here
    │   └── font-awesome.css
    ├── img                       - images used
    ├── js
    │   ├── bootstrap.js
    │   ├── custom.js             - custom javascript goes here
    │   └── jquery.js
    └── webfonts