QuestionQ9

DevSecOps Pipeline-Build and Test Stage

Andrew Gerrard has recently joined an IT company that develops software products and applications as a DevSecOps engineer. His team leader asked him to download a JAR application from the organization's GitHub repository and run the BDD security framework. Andrew successfully downloaded the JAR application from the repository and executed it, then cloned the BDD security framework.

Which of the following commands should Andrew use to execute the authentication feature?

  • A /gradlew -Dcucumber.options=“-tags @authentication -tags @skip”
  • B /gradlev -Dcucumber.options=“-tags @authentication -tags @skip”
  • C ./gradlew -Dcucumber.options=“-tags @authentication -tags ~@skip”
  • D ./gradlev -Dcucumber.options=“-tags @authentication -tags ~@skip”
Explanation

The Gradle wrapper executable on Unix-based systems is correctly named "gradlew" and must be run with the "./" prefix (./gradlew) to indicate it should execute from the current working directory; "gradlev" is not a valid file name and "/gradlew" implies an incorrect absolute path. In Cucumber tag expressions used with the -Dcucumber.options flag, the tilde (~) symbol is used to negate a tag, so "~@skip" correctly excludes scenarios tagged @skip while including those tagged @authentication, which is the intended behavior when running only the authentication feature without skipped tests.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!