Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment variable knobs to customise the E2E test runs. #707

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

otrho
Copy link
Contributor

@otrho otrho commented Jan 27, 2022

The harness will now check for the existence (but not care about the
value) of two environment variables while running tests:

  • SWAY_TEST_VERBOSE - this disables silent_mode and prints warnings
    and errors to stdout.
  • SWAY_TEST_USE_IR - this turns on the use_ir flag to run the tests
    using the IR pipeline (useful presently until IR becomes the default).

E.g.,

$ cd sway/test
$ SWAY_TEST_VERBOSE=yes cargo r neq
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
     Running `sway/target/debug/test neq`
 Compiling neq_4_test
  Compiled library "core".
  Compiled library "core".
warning
 --> FuelLabs-sway-lib-std-5a0938f/src/result.sw:0:5
  |
...
3 |     Ok: T,
  |     -- Enum variant Ok is never constructed.
  |
warning
 --> FuelLabs-sway-lib-std-5a0938f/src/result.sw:0:5
  |
...
4 |     Err: E,
  |     --- Enum variant Err is never constructed.
  |
  Compiled library "lib-std" with 2 warnings.
  Compiled script "neq_4_test".
  Bytecode size is 108 bytes.
   ABI gen neq_4_test
  Compiled library "core".
  Compiled library "core".
  Compiled library "lib-std" with 2 warnings.
  Compiled script "neq_4_test".
_________________________________
Tests passed.
1 tests run (81 skipped)

The harness will now check for the existence (but not care about the
value) of two environment variables while running tests:
- SWAY_TEST_VERBOSE - this disables `silent_mode` and prints warnings
  and errors to stdout.
- SWAY_TEST_USE_IR - this turns on the `use_ir` flag to run the tests
  using the IR pipeline (useful presently until IR becomes the default).
@otrho otrho added the testing General testing label Jan 27, 2022
@otrho otrho requested review from sezna and emilyaherbert January 27, 2022 00:09
@otrho otrho self-assigned this Jan 27, 2022
@adlerjohn
Copy link
Contributor

Is there a reason to use environment variables instead of CLI options?

@otrho
Copy link
Contributor Author

otrho commented Jan 27, 2022

Is there a reason to use environment variables instead of CLI options?

Only that it's simpler. Don't have to parse them and the pass them all the way from main(). I prefer it but maybe that's subjective.

Copy link
Contributor

@sezna sezna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the env vars.

@sezna sezna merged commit f326a66 into master Jan 28, 2022
@sezna sezna deleted the otrho/testing-env-var-knobs branch January 28, 2022 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing General testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants