Skip to content

Integration/smoke tests #139

@dmke

Description

@dmke

On the coming weekend In the coming days I'd like to extend the test suite with integration/smoke tests. The current suite exclusively relies on a stubbed HTTP endpoint (which is fine for local, fast tests), but doesn't actually tell me whether I can use the Gem with a specific version of InfluxDB.

Rationale

v0.11 for example introduced some subtle changes in SHOW SERIES and SHOW TAG VALUES—and although these queries are not natively covered by this Gem (yet), I would feel more confident if I can see a green smoke test result.

Battle plan

  • (1) Because I'm lazy, I want a script which generates a .travis.yml from the AWS bucket (or maybe another resource) with the latest n major versions, e.g. 0.12.1, 0.11.1 and 0.10.2 but neither 0.12.0, nor 0.11.0, nor 0.10.1.

    Each version should generate an matrix.include entry:

    It should be sufficient to include the .deb download file(s) in the build matrix:

    matrix:
      include:
        - rvm: 2.3.0
          env: USE_INFLUXDB="influxdb_0.11.1-1_amd64.deb"
        - rvm: 2.3.0
          env: USE_INFLUXDB="influxdb_0.12.1-1_amd64.deb"
        - # ...
  • (2) Depending on the presence of the $USE_INFLUXDB env var, a before_install or install script needs to provision the specified InfluxDB version.

  • (3) The Rake default task should, in presence of ENV["USE_INFLUXDB"], only fire up the smoke test suite (maybe I can leverage script to execute rake spec:integration or sth. similar).

  • (4) Finally, some actual smoke tests need to be written. As a first step, I'd transform the examples in the README.

Discussion

Did I miss something obvious? Am I crazy and shouldn't do this? Are there similar attempts in the other client library implementations (if not, should this be portable enough to act as reusable template)?

To keep my sanity, I don't really want to parse XML for (1). This might give me a nice starting point to find the relevant version prefixes, though (ex.).

/cc @toddboom

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions